Skip to content

Commit

Permalink
Added log failed to parse invalid yaml #2698 (#2699)
Browse files Browse the repository at this point in the history
  • Loading branch information
cx-joao-reigota authored Apr 5, 2021
1 parent 353d342 commit eb9932c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/parser/yaml/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ func (p *Parser) Parse(_ string, fileContent []byte) ([]model.Document, error) {
if err != nil {
return nil, errors.Wrap(err, "failed to Parse YAML")
}
if documents == nil {
return nil, errors.Wrap(errors.New("invalid yaml"), "failed to parse yaml")
}
}

return documents, nil
Expand Down

0 comments on commit eb9932c

Please sign in to comment.