diff options
author | Zach Copley <zach@status.net> | 2009-10-28 17:29:21 -0700 |
---|---|---|
committer | Zach Copley <zach@status.net> | 2009-10-28 17:29:21 -0700 |
commit | 03a1436a1c07c0867ca748560b37457f99ea1d66 (patch) | |
tree | 6bbce6ed7914a7e83f4d59175a5eb1ab0d2b9586 /actions | |
parent | 9ef05030fe623f18c64f9d24da1ebff04cf6cb62 (diff) |
Trap ClientExceptions from media upload process and hand them off to API error handler
Diffstat (limited to 'actions')
-rw-r--r-- | actions/apistatusesupdate.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/actions/apistatusesupdate.php b/actions/apistatusesupdate.php index 3a030f0fe..898a4bd72 100644 --- a/actions/apistatusesupdate.php +++ b/actions/apistatusesupdate.php @@ -192,7 +192,13 @@ class ApiStatusesUpdateAction extends ApiAuthAction } $upload = null; - $upload = MediaFile::fromUpload('media', $this->user); + + try { + $upload = MediaFile::fromUpload('media', $this->user); + } catch (ClientException $ce) { + $this->clientError($ce->getMessage()); + return; + } if (isset($upload)) { $status_shortened .= ' ' . $upload->shortUrl(); |