summaryrefslogtreecommitdiff
path: root/actions/updateprofile.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-03-01 15:31:20 -0500
committerEvan Prodromou <evan@status.net>2010-03-01 15:31:20 -0500
commit9b4ee9070467eb5df02b350e2e3d01a2c2497836 (patch)
tree15a27ee8afef4715db659db1e0508f74d73d739f /actions/updateprofile.php
parent90689008ee8649d9592ad97579d7de44d1ce389d (diff)
return correct HTTP status code for OMB errors
Diffstat (limited to 'actions/updateprofile.php')
-rw-r--r--actions/updateprofile.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/actions/updateprofile.php b/actions/updateprofile.php
index dfc31f542..44fafdd92 100644
--- a/actions/updateprofile.php
+++ b/actions/updateprofile.php
@@ -77,6 +77,14 @@ class UpdateprofileAction extends Action
$srv = new OMB_Service_Provider(null, omb_oauth_datastore(),
omb_oauth_server());
$srv->handleUpdateProfile();
+ } catch (OMB_RemoteServiceException $rse) {
+ $msg = $rse->getMessage();
+ if (preg_match('/^Revoked accesstoken/', $msg) ||
+ preg_match('/^No subscriber/', $msg)) {
+ $this->clientError($msg, 403);
+ } else {
+ $this->clientError($msg);
+ }
} catch (Exception $e) {
$this->serverError($e->getMessage());
return;