[open-ils-commits] r10792 - trunk/Open-ILS/src/perlmods/OpenILS/Application

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Oct 8 12:54:15 EDT 2008


Author: miker
Date: 2008-10-08 12:54:12 -0400 (Wed, 08 Oct 2008)
New Revision: 10792

Modified:
   trunk/Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm
Log:
protecting MARC::Batch->next with a try block

Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm	2008-10-08 16:24:25 UTC (rev 10791)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm	2008-10-08 16:54:12 UTC (rev 10792)
@@ -231,8 +231,15 @@
 	$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;



More information about the open-ils-commits mailing list