Merge pull request #1291 from XDRAGON2002/issue_1290

fix: yamlhandler error handling
This commit is contained in:
David Wertenteil
2023-07-25 14:39:26 +03:00
committed by GitHub
+2 -2
View File
@@ -23,8 +23,6 @@ func decodeDocumentRoots(yamlAsString string) ([]yaml.Node, error) {
var node yaml.Node
err := dec.Decode(&node)
nodes = append(nodes, node)
if errors.Is(err, io.EOF) {
break
}
@@ -32,6 +30,8 @@ func decodeDocumentRoots(yamlAsString string) ([]yaml.Node, error) {
return nil, fmt.Errorf("Cannot Decode File as YAML")
}
nodes = append(nodes, node)
}
return nodes, nil