We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 9b4ee907 authored by Evan Prodromou's avatar Evan Prodromou

return correct HTTP status code for OMB errors

parent 90689008
......@@ -74,6 +74,14 @@ class PostnoticeAction extends Action
$srv = new OMB_Service_Provider(null, omb_oauth_datastore(),
omb_oauth_server());
$srv->handlePostNotice();
} 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;
......
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment