summaryrefslogtreecommitdiff
path: root/lib/facebookutil.php
diff options
context:
space:
mode:
authorZach Copley <zach@controlyourself.ca>2009-07-27 02:54:51 +0000
committerZach Copley <zach@controlyourself.ca>2009-08-08 00:57:21 +0000
commit239990813851a5c44200919f47eb10596fda14f4 (patch)
tree0a05e40dc4e000e5fb7c6ee771e2b5fd240d714e /lib/facebookutil.php
parentabdd4a3c3eae5dae8935cecf9bcc5239653100d2 (diff)
Better error handling when updating Facebook
Diffstat (limited to 'lib/facebookutil.php')
-rw-r--r--lib/facebookutil.php13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/facebookutil.php b/lib/facebookutil.php
index 85077c254..b7688f04f 100644
--- a/lib/facebookutil.php
+++ b/lib/facebookutil.php
@@ -193,14 +193,16 @@ function facebookBroadcastNotice($notice)
$facebook->api_client->users_setStatus($status, $fbuid, false, true);
}
} catch(FacebookRestClientException $e) {
- common_log(LOG_ERR, $e->getMessage());
+
+ $code = $e->getCode();
+
+ common_log(LOG_ERR, 'Facebook returned error code ' .
+ $code . ': ' . $e->getMessage());
common_log(LOG_ERR,
'Unable to update Facebook status for ' .
"$user->nickname (user id: $user->id)!");
- $code = $e->getCode();
-
- if ($code >= 200) {
+ if ($code == 200 || $code == 250) {
// 200 The application does not have permission to operate on the passed in uid parameter.
// 250 Updating status requires the extended permission status_update or publish_stream.
@@ -216,7 +218,8 @@ function facebookBroadcastNotice($notice)
try {
updateProfileBox($facebook, $flink, $notice);
} catch(FacebookRestClientException $e) {
- common_log(LOG_WARNING, $e->getMessage());
+ common_log(LOG_ERR, 'Facebook returned error code ' .
+ $e->getCode() . ': ' . $e->getMessage());
common_log(LOG_WARNING,
'Unable to update Facebook profile box for ' .
"$user->nickname (user id: $user->id).");