[open-ils-commits] r14765 - trunk/Open-ILS/src/perlmods/OpenILS/Application (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Nov 4 11:23:40 EST 2009


Author: erickson
Date: 2009-11-04 11:23:38 -0500 (Wed, 04 Nov 2009)
New Revision: 14765

Modified:
   trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger.pm
Log:
don't die silently, let's log some error output to look for patterns

Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger.pm	2009-11-04 15:08:38 UTC (rev 14764)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger.pm	2009-11-04 16:23:38 UTC (rev 14765)
@@ -536,13 +536,20 @@
         my $e;
         try {
            $e = OpenILS::Application::Trigger::Event->new($e_id);
-        } otherwise {};
+        } catch Error with {
+            $logger->error("Event creation failed with ".shift());
+        };
 
         next unless $e; 
+        my $valid;
 
-        if (try { $e->validate->valid } otherwise { $e = undef; }) {
+        try {
+            $valid = $e->validate->valid;
+        } catch Error with {
+            $logger->error("Event validation failed with ".shift());
+        };
 
-            next unless $e;
+        if ($valid) {
 
             if (my $group = $e->event->event_def->group_field) {
 
@@ -591,9 +598,8 @@
                             ->method_lookup('open-ils.trigger.event.fire')
                             ->run($event)
                     );
-                } otherwise { 
-                    # un-oh
-                    $logger->error("event firing failed");
+                } catch Error with { 
+                    $logger->error("event firing failed with ".shift());
                 };
             }
         } else {
@@ -605,9 +611,8 @@
                             ->method_lookup('open-ils.trigger.event_group.fire')
                             ->run($$defgroup{$ident})
                     );
-                } otherwise {
-                    # uh-oh
-                    $logger->error("event group firing failed");
+                } catch Error with {
+                    $logger->error("event firing failed with ".shift());
                 };
             }
         }



More information about the open-ils-commits mailing list