Skip to content

Instantly share code, notes, and snippets.

@mrvdb
Created June 19, 2014 00:12
Show Gist options
  • Save mrvdb/4945a9477ee49c3e3162 to your computer and use it in GitHub Desktop.
Save mrvdb/4945a9477ee49c3e3162 to your computer and use it in GitHub Desktop.
diff --git a/plugins/TwitterBridge/lib/tweetinqueuehandler.php b/plugins/TwitterBridge/lib/tweetinqueuehandler.php
index 79d36d1..d0e877d 100644
--- a/plugins/TwitterBridge/lib/tweetinqueuehandler.php
+++ b/plugins/TwitterBridge/lib/tweetinqueuehandler.php
@@ -55,7 +55,14 @@ class TweetInQueueHandler extends QueueHandler
if ($flink instanceof Foreign_link) {
common_log(LOG_DEBUG, "TweetInQueueHandler - Got flink so add notice ".
$notice->id." to attentions for user ".$flink->user_id);
- Attention::saveNew($notice, $flink->getProfile());
+ try {
+ Attention::saveNew($notice, $flink->getProfile());
+ } catch (Exception $e) {
+ // Log the exception, but make sure we don't bail out, we
+ // still have a queue item to remove here-after.
+ common_log(LOG_ERR,"Adding notice ".
+ $notice->id." to attentions for user ". $flink->user_id . ": " . $e->getMessage());
+ }
} else {
common_log(LOG_DEBUG, "TweetInQueueHandler - No flink found for foreign user ".$receiver);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment