From 0faa988e91056564b2ae19f045a81b322cce4e0c Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Thu, 29 Jul 2010 20:31:22 +0000 Subject: Fix for issue ID 2290: make sure errors are returned in the right format, and use callback for errors when the request is JSONP --- actions/apimediaupload.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'actions/apimediaupload.php') 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; } } -- cgit v1.2.3-54-g00ecf