Skip to content

Commit

Permalink
Make sure we always set ParseErr line number
Browse files Browse the repository at this point in the history
  • Loading branch information
prymitive committed Feb 21, 2025
1 parent 9bd8190 commit 3ec2cfc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/parser/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (p Parser) Parse(content []byte) (rules []Rule, err error) {

defer func() {
if r := recover(); r != nil {
err = ParseError{Err: fmt.Errorf("unable to parse YAML file: %s", r)}
err = ParseError{Line: 1, Err: fmt.Errorf("unable to parse YAML file: %s", r)}
}
}()

Expand Down

0 comments on commit 3ec2cfc

Please sign in to comment.