summaryrefslogtreecommitdiff
path: root/actions/apistatusesupdate.php
diff options
context:
space:
mode:
authorZach Copley <zach@status.net>2010-07-29 20:44:11 +0000
committerZach Copley <zach@status.net>2010-07-29 20:44:11 +0000
commitfb2e00eacc7090df0d05311e39f08cb72164a78c (patch)
tree7a3d33d537d9c2bcd5f2c8c58ed38790e1e7c248 /actions/apistatusesupdate.php
parentfadeafbccc804063240c4f799a29e3ffa04b73e7 (diff)
parent0faa988e91056564b2ae19f045a81b322cce4e0c (diff)
Merge branch 'master' into 0.9.x
Conflicts: classes/Notice.php
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;
}