Report while filename failed to parse #1030

This commit is contained in:
Mike Farah
2021-12-06 17:25:32 +11:00
parent c17cf82791
commit ffd1f022aa
3 changed files with 5 additions and 3 deletions
+2 -1
View File
@@ -3,6 +3,7 @@ package yqlib
import (
"container/list"
"errors"
"fmt"
"io"
"os"
@@ -100,7 +101,7 @@ func (s *streamEvaluator) Evaluate(filename string, reader io.Reader, node *Expr
s.fileIndex = s.fileIndex + 1
return currentIndex, nil
} else if errorReading != nil {
return currentIndex, errorReading
return currentIndex, fmt.Errorf("bad file '%v': %w", filename, errorReading)
}
candidateNode := &CandidateNode{