summaryrefslogtreecommitdiff
path: root/actions/apistatusesupdate.php
diff options
context:
space:
mode:
Diffstat (limited to 'actions/apistatusesupdate.php')
-rw-r--r--actions/apistatusesupdate.php17
1 files changed, 11 insertions, 6 deletions
diff --git a/actions/apistatusesupdate.php b/actions/apistatusesupdate.php
index d65a068f5..fa3f611c0 100644
--- a/actions/apistatusesupdate.php
+++ b/actions/apistatusesupdate.php
@@ -196,7 +196,8 @@ class ApiStatusesUpdateAction extends ApiAuthAction
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
$this->clientError(
_('This method requires a POST.'),
- 400, $this->format
+ 400,
+ $this->format
);
return;
}
@@ -217,7 +218,7 @@ class ApiStatusesUpdateAction extends ApiAuthAction
if (empty($this->status)) {
$this->clientError(
- 'Client must provide a \'status\' parameter with a value.',
+ _('Client must provide a \'status\' parameter with a value.'),
400,
$this->format
);
@@ -291,8 +292,8 @@ class ApiStatusesUpdateAction extends ApiAuthAction
try {
$upload = MediaFile::fromUpload('media', $this->auth_user);
- } catch (ClientException $ce) {
- $this->clientError($ce->getMessage());
+ } catch (Exception $e) {
+ $this->clientError($e->getMessage(), $e->getCode(), $this->format);
return;
}
@@ -305,7 +306,11 @@ class ApiStatusesUpdateAction extends ApiAuthAction
'Max notice size is %d chars, ' .
'including attachment URL.'
);
- $this->clientError(sprintf($msg, Notice::maxContent()));
+ $this->clientError(
+ sprintf($msg, Notice::maxContent()),
+ 400,
+ $this->format
+ );
}
}
@@ -332,7 +337,7 @@ class ApiStatusesUpdateAction extends ApiAuthAction
$options
);
} catch (Exception $e) {
- $this->clientError($e->getMessage());
+ $this->clientError($e->getMessage(), $e->getCode(), $this->format);
return;
}