Skip to content

Commit

Permalink
Add file path to parsing error
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyakuz-db committed Jan 22, 2025
1 parent 6e8f5f3 commit cf42459
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion acceptance/bundle/variables/var_file_overrides/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cmd/bundle/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
Expand Down

0 comments on commit cf42459

Please sign in to comment.