]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Handle exceptions in QueueHandler classes
authorMikael Nordfeldth <mmn@hethane.se>
Thu, 14 Jan 2016 00:47:13 +0000 (01:47 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Thu, 14 Jan 2016 00:47:13 +0000 (01:47 +0100)
lib/dbqueuemanager.php

index 9fb77eed9645c380beb0901042e21a7854048321..3adac08971f8095d21424a605b29099e1da08158 100644 (file)
@@ -91,7 +91,13 @@ class DBQueueManager extends QueueManager
         
         $handler = $this->getHandler($qi->transport);
         if ($handler) {
-            if ($handler->handle($item)) {
+            try {
+                $result = $handler->handle($item)
+            } catch (Exception $e) {
+                $result = false;
+                $this->_log(LOG_ERR, "[{$qi->transport}:$rep] Exception thrown: {$e->getMessage()}");
+            }
+            if ($result) {
                 $this->_log(LOG_INFO, "[{$qi->transport}:$rep] Successfully handled item");
                 $this->_done($qi);
             } else {