summaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
authorZach Copley <zach@status.net>2009-10-28 17:29:21 -0700
committerZach Copley <zach@status.net>2009-10-28 17:29:21 -0700
commit03a1436a1c07c0867ca748560b37457f99ea1d66 (patch)
tree6bbce6ed7914a7e83f4d59175a5eb1ab0d2b9586 /actions
parent9ef05030fe623f18c64f9d24da1ebff04cf6cb62 (diff)
Trap ClientExceptions from media upload process and hand them off to API error handler
Diffstat (limited to 'actions')
-rw-r--r--actions/apistatusesupdate.php8
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();