wrapping write to *.iso file in eval{}, to handle failure, caused by bad record.
authorMason James <mtj@liblime.com>
Sun, 11 Nov 2007 23:58:32 +0000 (17:58 -0600)
committerJoshua Ferraro <jmf@liblime.com>
Mon, 12 Nov 2007 00:44:12 +0000 (18:44 -0600)
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
misc/migration_tools/rebuild_zebra_idx.pl

index 680c00e..ecc0909 100755 (executable)
@@ -43,7 +43,8 @@ while ((my $biblionumber) = $sth->fetchrow) {
        my $record = GetMarcBiblio($biblionumber);
        my $filename = $cgidir."/tmp/BIBLIO".$biblionumber.".iso2709";
        open F,"> $filename";
-       print F $record->as_usmarc();
+    eval {print F $record->as_usmarc(); };
+    warn "ERROR: writing biblio $biblionumber failed" if $@;
        close F;
        $i++;
        print "\r$i" unless ($i % 100);