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
@@ -4,6 +4,7 @@ import (
"bufio"
"container/list"
"errors"
"fmt"
"io"
"os"
"regexp"
@@ -122,7 +123,7 @@ func readDocuments(reader io.Reader, filename string, fileIndex int) (*list.List
}
return inputList, nil
} else if errorReading != nil {
return nil, errorReading
return nil, fmt.Errorf("bad file '%v': %w", filename, errorReading)
}
candidateNode := &CandidateNode{
Document: currentIndex,