summaryrefslogtreecommitdiff
path: root/actions/apimediaupload.php
diff options
context:
space:
mode:
authorZach Copley <zach@status.net>2010-07-29 20:31:22 +0000
committerZach Copley <zach@status.net>2010-07-29 20:31:22 +0000
commit0faa988e91056564b2ae19f045a81b322cce4e0c (patch)
tree79187009708588586bc3d3c087507408b89fd822 /actions/apimediaupload.php
parent4e8e77f6b091e024f58241c2807c61e0b7930e5c (diff)
Fix for issue ID 2290: make sure errors are returned in the right
format, and use callback for errors when the request is JSONP
Diffstat (limited to 'actions/apimediaupload.php')
-rw-r--r--actions/apimediaupload.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/actions/apimediaupload.php b/actions/apimediaupload.php
index ec316edc8..7aa88c186 100644
--- a/actions/apimediaupload.php
+++ b/actions/apimediaupload.php
@@ -88,15 +88,15 @@ class ApiMediaUploadAction 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());
return;
}
if (isset($upload)) {
$this->showResponse($upload);
} else {
- $this->clientError('Upload failed.');
+ $this->clientError(_('Upload failed.'));
return;
}
}