on exceptions, stomp logs the error and reenqueues

This commit is contained in:
Evan Prodromou 2010-01-30 13:15:17 -05:00
parent def5d56ce1
commit 4ae31f3476
1 changed files with 14 additions and 7 deletions

View File

@ -31,7 +31,6 @@
require_once 'Stomp.php';
require_once 'Stomp/Exception.php';
class StompQueueManager extends QueueManager
{
protected $servers;
@ -587,7 +586,15 @@ class StompQueueManager extends QueueManager
return false;
}
// If there's an exception when handling,
// log the error and let it get requeued.
try {
$ok = $handler->handle($item);
} catch (Exception $e) {
$this->_log(LOG_ERR, "Exception on queue $queue: " . $e->getMessage());
$ok = false;
}
if (!$ok) {
$this->_log(LOG_WARNING, "Failed handling $info");