Trap ClientExceptions from media upload process and hand them off to API error handler

This commit is contained in:
Zach Copley 2009-10-28 17:29:21 -07:00
parent 9ef05030fe
commit 03a1436a1c

View File

@ -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();