From: Mikael Nordfeldth Date: Thu, 14 Jan 2016 00:47:13 +0000 (+0100) Subject: Handle exceptions in QueueHandler classes X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=0ddaa6ff75e2b7637772368a9c83027d53765906;p=quix0rs-gnu-social.git Handle exceptions in QueueHandler classes --- diff --git a/lib/dbqueuemanager.php b/lib/dbqueuemanager.php index 9fb77eed96..3adac08971 100644 --- a/lib/dbqueuemanager.php +++ b/lib/dbqueuemanager.php @@ -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 {