]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
log errors in handling notices
authorEvan Prodromou <evan@controlyourself.ca>
Wed, 8 Jul 2009 05:36:12 +0000 (01:36 -0400)
committerEvan Prodromou <evan@controlyourself.ca>
Wed, 8 Jul 2009 05:36:12 +0000 (01:36 -0400)
lib/stompqueuemanager.php

index e7e1e00dd9743aa82ff4d444306ff39067442b16..06be2ba850077611bb978f001a4bb45ff4ef32e6 100644 (file)
@@ -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);
                 }