From cac70aded539ae2369983a6880a0969293bc314c Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Mon, 19 Mar 2018 19:40:51 -0400 Subject: [PATCH] Make the error message that comes from parsing the config file more useful. Fixes #2080 --- command/config/config.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/command/config/config.go b/command/config/config.go index 366d34197f..4697a7494e 100644 --- a/command/config/config.go +++ b/command/config/config.go @@ -64,7 +64,12 @@ func LoadConfig(path string) (*DefaultConfig, error) { return nil, err } - return ParseConfig(string(contents)) + conf, err := ParseConfig(string(contents)) + if err != nil { + return nil, fmt.Errorf("Error parsing config file at %s: %q. Ensure that the file is valid; Ansible Vault is known to conflict with it.", path, err) + } + + return conf, nil } // ParseConfig parses the given configuration as a string.