Patch from Joe Atzberger to verify custom filter file opened successfully
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 21 Jan 2010 18:06:26 +0000 (18:06 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 21 Jan 2010 18:06:26 +0000 (18:06 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@15359 dcc99617-32d9-48b4-a31d-7c20da2025e4

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

index 757b1a5..2a48136 100755 (executable)
@@ -62,9 +62,12 @@ my $hook_handlers = {
 };
 
 if ($opt_custom_filter) {
 };
 
 if ($opt_custom_filter) {
-    open FILTERS, $opt_custom_filter;
-    $hook_handlers = OpenSRF::Utils::JSON->JSON2perl(join('',(<FILTERS>)));
-    close FILTERS;
+    if (open FILTERS, $opt_custom_filter) {
+        $hook_handlers = OpenSRF::Utils::JSON->JSON2perl(join('',(<FILTERS>)));
+        close FILTERS;
+    } else {
+        die "Cannot read filter file '$opt_custom_filter'";
+    }
 }
 
 sub help {
 }
 
 sub help {