Display available error information during bulkmarcimport

This commit is contained in:
MJ Ray 2010-10-13 02:17:05 +01:00
parent df47a149b0
commit 65f8573b5d

View file

@ -169,13 +169,14 @@ RECORD: while ( ) {
# get records # get records
eval { $record = $batch->next() }; eval { $record = $batch->next() };
if ( $@ ) { if ( $@ ) {
print "Bad MARC record: skipped\n"; print "Bad MARC record $i: $@ skipped\n";
# FIXME - because MARC::Batch->next() combines grabbing the next # FIXME - because MARC::Batch->next() combines grabbing the next
# blob and parsing it into one operation, a correctable condition # blob and parsing it into one operation, a correctable condition
# such as a MARC-8 record claiming that it's UTF-8 can't be recovered # such as a MARC-8 record claiming that it's UTF-8 can't be recovered
# from because we don't have access to the original blob. Note # from because we don't have access to the original blob. Note
# that the staging import can deal with this condition (via # that the staging import can deal with this condition (via
# C4::Charset::MarcToUTF8Record) because it doesn't use MARC::Batch. # C4::Charset::MarcToUTF8Record) because it doesn't use MARC::Batch.
$i++;
next; next;
} }
# skip if we get an empty record (that is MARC valid, but will result in AddBiblio failure # skip if we get an empty record (that is MARC valid, but will result in AddBiblio failure