Skip to content

Commit

Permalink
fix: Specify where in YAML validation error occurred (#5174)
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Behar <simbeh7@gmail.com>
  • Loading branch information
simster7 committed Feb 23, 2021
1 parent 4b78a7e commit a9c4200
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/validator.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package validation

import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
Expand Down Expand Up @@ -64,7 +65,7 @@ func ValidateArgoYamlRecursively(fromPath string, skipFileNames []string) (map[s
if !result.Valid() {
errorDescriptions := []string{}
for _, err := range result.Errors() {
errorDescriptions = append(errorDescriptions, err.Description())
errorDescriptions = append(errorDescriptions, fmt.Sprintf("%s in %s", err.Description(), err.Context().String()))
}
failed[path] = errorDescriptions
}
Expand Down

0 comments on commit a9c4200

Please sign in to comment.