Skip to content

Commit 4b7031f

Browse files
authored
add more context to packer vault func error message (#41)
1 parent 1f91e2a commit 4b7031f

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

template/funcs.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,10 @@ func Vault(path string, key string) (string, error) {
5656
}
5757

5858
// neither v1 nor v2 proudced a valid value
59-
return "", fmt.Errorf("Vault data was empty at the given path. Warnings: %s", strings.Join(secret.Warnings, "; "))
59+
return "", fmt.Errorf("Vault data was empty at the given path. Check "+
60+
"the Vault function docs for help: "+
61+
"https://www.packer.io/docs/templates/hcl_templates/functions/contextual/vault. "+
62+
"Original warnings from Vault call: %s", strings.Join(secret.Warnings, "; "))
6063
}
6164

6265
if val, ok := data.(map[string]interface{})[key]; ok {

0 commit comments

Comments
 (0)