Ticket #2724: gracefully handle attempts to delete or fave/unfave a remote Twitter notice if a failure occurs.
Most annoying error case being where the notice was already faved or deleted on Twitter! :) Such errors will now just fail out and log a note to the syslog -- the rest of what we were doing will continue on unhindered, so you can still delete, favorite, etc and it just won't sync the info over in that case.
This commit is contained in:
parent
4193a826d3
commit
94f2f96f2e
|
@ -427,10 +427,14 @@ class TwitterBridgePlugin extends Plugin
|
|||
return true;
|
||||
}
|
||||
|
||||
try {
|
||||
$token = TwitterOAuthClient::unpackToken($flink->credentials);
|
||||
$client = new TwitterOAuthClient($token->key, $token->secret);
|
||||
|
||||
$client->statusesDestroy($n2s->status_id);
|
||||
} catch (Exception $e) {
|
||||
common_log(LOG_ERR, "Error attempting to delete bridged notice from Twitter: " . $e->getMessage());
|
||||
}
|
||||
|
||||
$n2s->delete();
|
||||
}
|
||||
|
@ -464,10 +468,14 @@ class TwitterBridgePlugin extends Plugin
|
|||
return true;
|
||||
}
|
||||
|
||||
try {
|
||||
$token = TwitterOAuthClient::unpackToken($flink->credentials);
|
||||
$client = new TwitterOAuthClient($token->key, $token->secret);
|
||||
|
||||
$client->favoritesCreate($status_id);
|
||||
} catch (Exception $e) {
|
||||
common_log(LOG_ERR, "Error attempting to favorite bridged notice on Twitter: " . $e->getMessage());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -500,10 +508,14 @@ class TwitterBridgePlugin extends Plugin
|
|||
return true;
|
||||
}
|
||||
|
||||
try {
|
||||
$token = TwitterOAuthClient::unpackToken($flink->credentials);
|
||||
$client = new TwitterOAuthClient($token->key, $token->secret);
|
||||
|
||||
$client->favoritesDestroy($status_id);
|
||||
} catch (Exception $e) {
|
||||
common_log(LOG_ERR, "Error attempting to unfavorite bridged notice on Twitter: " . $e->getMessage());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user