command: make error message clearer for invalid tfvars format [GH-1889]
This commit is contained in:
parent
a3a9d5d21d
commit
a76105b0f1
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue