Return the original error as well
@@ -156,14 +156,11 @@ func (r *Reader) Read() (File, error) {
lineLength = len(line) // len(line) may have changed
r.line = line
- if lineLength != RecordLength {
- r.errors.Add(r.parseError(NewRecordWrongLengthErr(lineLength)))
- } else {
// parse the line
if err := r.parseLine(); err != nil {
+ r.errors.Add(r.parseError(NewRecordWrongLengthErr(lineLength)))
r.errors.Add(err)
}
- }
default:
r.line = line
