Skip to content
This repository has been archived by the owner on Feb 4, 2020. It is now read-only.

Commit

Permalink
MARCMaker error
Browse files Browse the repository at this point in the history
Now pymarc will at least complain about the record length being invalid rather
than throwing a ValueError because it can't convert =LDR into an integer.
  • Loading branch information
edsu committed Jul 26, 2017
1 parent 7e2a01f commit 7741c4d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pymarc/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,11 @@ def __next__(self):
if len(first5) < 5:
raise RecordLengthInvalid

length = int(first5)
try:
length = int(first5)
except ValueError:
raise RecordLengthInvalid

chunk = self.file_handle.read(length - 5)
chunk = first5 + chunk
record = Record(chunk,
Expand Down

0 comments on commit 7741c4d

Please sign in to comment.