API - handle any exceptions thrown during notice save. The API was
occasionally spitting out HTML, which is hard for clients to deal with.
This commit is contained in:
parent
c09db79b95
commit
e10d023d03
@ -244,11 +244,17 @@ class ApiStatusesUpdateAction extends ApiAuthAction
|
|||||||
$options = array_merge($options, $locOptions);
|
$options = array_merge($options, $locOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->notice =
|
try {
|
||||||
Notice::saveNew($this->auth_user->id,
|
$this->notice = Notice::saveNew(
|
||||||
|
$this->auth_user->id,
|
||||||
$content,
|
$content,
|
||||||
$this->source,
|
$this->source,
|
||||||
$options);
|
$options
|
||||||
|
);
|
||||||
|
} catch (Exception $e) {
|
||||||
|
$this->clientError($e->getMessage());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (isset($upload)) {
|
if (isset($upload)) {
|
||||||
$upload->attachToNotice($this->notice);
|
$upload->attachToNotice($this->notice);
|
||||||
|
Loading…
Reference in New Issue
Block a user