Protect against errors returned by open-ils.search
authordbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 26 Apr 2011 17:18:14 +0000 (17:18 +0000)
committerdbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 26 Apr 2011 17:18:14 +0000 (17:18 +0000)
If open-ils.search returns an error rather than a result, prevent
authority_control_fields.pl from bombing out completely; instead,
flag the problem in STDERR and move on to the next record.

git-svn-id: svn://svn.open-ils.org/ILS/trunk@20323 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/support-scripts/authority_control_fields.pl

index a7b6b75..290d036 100755 (executable)
@@ -395,6 +395,12 @@ foreach my $rec_id (@records) {
 
             # print Dumper($validates);
 
+            # Protect against failed (error condition) search request
+            if (!$validates) {
+                print STDERR "Search for matching authority failed; record # $rec_id\n";
+                next;
+            }
+
             if (scalar(@$validates) == 0) {
                 next;
             }