From 03a1436a1c07c0867ca748560b37457f99ea1d66 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Wed, 28 Oct 2009 17:29:21 -0700 Subject: [PATCH] Trap ClientExceptions from media upload process and hand them off to API error handler --- actions/apistatusesupdate.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/actions/apistatusesupdate.php b/actions/apistatusesupdate.php index 3a030f0fe8..898a4bd723 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();