diff options
author | Evan Prodromou <evan@controlyourself.ca> | 2009-07-08 01:36:12 -0400 |
---|---|---|
committer | Evan Prodromou <evan@controlyourself.ca> | 2009-07-08 01:36:12 -0400 |
commit | a626f32d8e01faa620a11e1f8370a35cc660a579 (patch) | |
tree | 3c94fe954d83ba99f8d960501e67db961fbb720a | |
parent | f6c8efdce641809d71067967225204ae9116af96 (diff) |
log errors in handling notices
-rw-r--r-- | lib/stompqueuemanager.php | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/stompqueuemanager.php b/lib/stompqueuemanager.php index e7e1e00dd..06be2ba85 100644 --- a/lib/stompqueuemanager.php +++ b/lib/stompqueuemanager.php @@ -100,11 +100,16 @@ class StompQueueManager $notice = Notice::staticGet('id', $frame->body); if (empty($notice)) { - $this->_log(LOG_WARNING, 'Got ID '. $frame->body .' for non-existent notice'); - $this->con->ack($frame); - } else if ($handler->handle_notice($notice)) { - $this->_log(LOG_INFO, 'Successfully handled notice '. $notice->id .' posted at ' . $frame->headers['created']); + $this->_log(LOG_WARNING, 'Got ID '. $frame->body .' for non-existent notice in queue '. $queue); $this->con->ack($frame); + } else { + if ($handler->handle_notice($notice)) { + $this->_log(LOG_INFO, 'Successfully handled notice '. $notice->id .' posted at ' . $frame->headers['created'] . ' in queue '. $queue); + $this->con->ack($frame); + } else { + $this->_log(LOG_WARNING, 'Failed handling notice '. $notice->id .' posted at ' . $frame->headers['created'] . ' in queue '. $queue); + // Don't ack; it'll get re-sent + } unset($notice); } |