do something useful (log) when the eval block horks
[migration-tools.git] / fingerprinter
index 424db25..9c99ef1 100755 (executable)
@@ -6,6 +6,7 @@ use open ':utf8';
 use Getopt::Long;
 use MARC::Batch;
 use Unicode::Normalize;
+use MARC::File::XML ( BinaryEncoding => 'utf-8' );
 
 my $conf  = {}; # configuration hashref
 my $count = 0;
@@ -29,6 +30,8 @@ for my $file (@ARGV) {
     $batch->warnings_off();
 
     while ( eval { $record = $batch->next } ) {
+        if ($@)
+          { print XF "MARC::Batch error $@"; next }
         my $marc = undef;
         $count++; progress_ticker();
         unless ( defined $record )