Trap ClientExceptions from media upload process and hand them off to API error handler
This commit is contained in:
parent
9ef05030fe
commit
03a1436a1c
@ -192,7 +192,13 @@ class ApiStatusesUpdateAction extends ApiAuthAction
|
||||
}
|
||||
|
||||
$upload = null;
|
||||
|
||||
try {
|
||||
$upload = MediaFile::fromUpload('media', $this->user);
|
||||
} catch (ClientException $ce) {
|
||||
$this->clientError($ce->getMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
if (isset($upload)) {
|
||||
$status_shortened .= ' ' . $upload->shortUrl();
|
||||
|
Loading…
Reference in New Issue
Block a user