We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit e10d023d authored by Zach Copley's avatar Zach Copley

API - handle any exceptions thrown during notice save. The API was

occasionally spitting out HTML, which is hard for clients to deal
with.
parent c09db79b
......@@ -244,11 +244,17 @@ class ApiStatusesUpdateAction extends ApiAuthAction
$options = array_merge($options, $locOptions);
}
$this->notice =
Notice::saveNew($this->auth_user->id,
$content,
$this->source,
$options);
try {
$this->notice = Notice::saveNew(
$this->auth_user->id,
$content,
$this->source,
$options
);
} catch (Exception $e) {
$this->clientError($e->getMessage());
return;
}
if (isset($upload)) {
$upload->attachToNotice($this->notice);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment