From f6b17c1de9079adc406abe5d4d72d8772d0c2311 Mon Sep 17 00:00:00 2001 From: Mason James Date: Sun, 11 Nov 2007 17:58:32 -0600 Subject: [PATCH] wrapping write to *.iso file in eval{}, to handle failure, caused by bad record. Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- misc/migration_tools/rebuild_zebra_idx.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/misc/migration_tools/rebuild_zebra_idx.pl b/misc/migration_tools/rebuild_zebra_idx.pl index 680c00ebac..ecc0909a13 100755 --- a/misc/migration_tools/rebuild_zebra_idx.pl +++ b/misc/migration_tools/rebuild_zebra_idx.pl @@ -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); -- 2.39.5