From 98dce599d91555721ee18c43c259b7b32174c4c5 Mon Sep 17 00:00:00 2001 From: miker Date: Wed, 8 Oct 2008 16:54:12 +0000 Subject: [PATCH] protecting MARC::Batch->next with a try block git-svn-id: svn://svn.open-ils.org/ILS/trunk@10792 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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; -- 2.43.2