Improve config.go: return error when recover a panic.