Remove unnecessary locations

This commit is contained in:
Ilya Kuznetsov 2025-01-21 18:19:22 +01:00
parent e0c81f0818
commit 38b7d275f7
No known key found for this signature in database
GPG Key ID: 91F3DDCF5D21CDDF
2 changed files with 3 additions and 5 deletions

View File

@ -70,7 +70,6 @@ Exit code: 1
=== file has wrong structure
>>> errcode $CLI bundle validate -o json --var-file=var_files/wrong_file_structure.json
Error: failed to parse variables file: var_files/wrong_file_structure.json:1:1: expected a map, found a sequence
in var_files/wrong_file_structure.json:1:1
Variables file must be a JSON object with the following format:
{"var1": "value1", "var2": "value2"}

View File

@ -42,10 +42,9 @@ func configureVariablesFromFile(cmd *cobra.Command, b *bundle.Bundle, filePath s
err = convert.ToTyped(&vars, val)
if err != nil {
return diags.Append(diag.Diagnostic{
Severity: diag.Error,
Summary: "failed to parse variables file: " + err.Error(),
Detail: "Variables file must be a JSON object with the following format:\n{\"var1\": \"value1\", \"var2\": \"value2\"}",
Locations: val.Locations(),
Severity: diag.Error,
Summary: "failed to parse variables file: " + err.Error(),
Detail: "Variables file must be a JSON object with the following format:\n{\"var1\": \"value1\", \"var2\": \"value2\"}",
})
}