command: make error message clearer for invalid tfvars format [GH-1889]

This commit is contained in:
Mitchell Hashimoto 2015-06-25 17:56:37 -07:00
parent a3a9d5d21d
commit a76105b0f1
1 changed files with 5 additions and 1 deletions

View File

@ -80,7 +80,11 @@ func loadKVFile(rawPath string) (map[string]string, error) {
var result map[string]string var result map[string]string
if err := hcl.DecodeObject(&result, obj); err != nil { if err := hcl.DecodeObject(&result, obj); err != nil {
return nil, err return nil, fmt.Errorf(
"Error decoding Terraform vars file: %s\n\n"+
"The vars file should be in the format of `key = \"value\"`.\n"+
"Decoding errors are usually caused by an invalid format.",
err)
} }
return result, nil return result, nil