From: miker Date: Wed, 8 Oct 2008 16:54:12 +0000 (+0000) Subject: protecting MARC::Batch->next with a try block X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=98dce599d91555721ee18c43c259b7b32174c4c5;p=Evergreen.git protecting MARC::Batch->next with a try block git-svn-id: svn://svn.open-ils.org/ILS/trunk@10792 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm b/Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm index 233937d4ca..9aa7c6c2fd 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm @@ -231,8 +231,15 @@ sub process_spool { $batch->strict_off; my $count = 0; - while (my $r = $batch->next) { - $logger->info("processing record $count"); + my $r = -1; + while (try { $r = $batch->next } otherwise { $r = -1 }) { + if ($r == -1) { + $logger->warn("Proccessing of record $count in set $fingerprint failed. Skipping this record"); + $count++; + } + + $logger->info("processing record $count"); + try { (my $xml = $r->as_xml_record()) =~ s/\n//sog; $xml =~ s/^<\?xml.+\?\s*>//go;