include file name in the error when visiting files

This commit is contained in:
Di Xu
2018-03-08 18:11:04 +08:00
parent a0844c17bf
commit a08cb5b531
3 changed files with 3 additions and 3 deletions

View File

@@ -578,7 +578,7 @@ func (v *StreamVisitor) Visit(fn VisitorFunc) error {
if err == io.EOF {
return nil
}
return err
return fmt.Errorf("error parsing %s: %v", v.Source, err)
}
// TODO: This needs to be able to handle object in other encodings and schemas.
ext.Raw = bytes.TrimSpace(ext.Raw)