Add file path to parsing error

This commit is contained in:
Ilya Kuznetsov 2025-01-22 15:46:30 +01:00
parent 6e8f5f3ace
commit cf42459b34
No known key found for this signature in database
GPG Key ID: 91F3DDCF5D21CDDF
2 changed files with 2 additions and 2 deletions

View File

@ -55,7 +55,7 @@ Exit code: 1
=== file cannot be parsed
>>> errcode $CLI bundle validate -o json --var-file=var_files/invalid_json.json
Error: failed to parse variables file: error decoding JSON at :0:0: invalid character 'o' in literal false (expecting 'a')
Error: failed to parse variables file var_files/invalid_json.json: error decoding JSON at :0:0: invalid character 'o' in literal false (expecting 'a')
Exit code: 1

View File

@ -35,7 +35,7 @@ func configureVariablesFromFile(cmd *cobra.Command, b *bundle.Bundle, filePath s
val, err := jsonloader.LoadJSON(f, filePath)
if err != nil {
return diag.FromErr(fmt.Errorf("failed to parse variables file: %w", err))
return diag.FromErr(fmt.Errorf("failed to parse variables file %s: %w", filePath, err))
}
vars := map[string]any{}