mirror of
https://github.com/friendica/friendica
synced 2025-04-26 00:30:12 +00:00
Move jsonError out of Factory\Api\Mastodon\Error->InternalError
This commit is contained in:
parent
696c56b6be
commit
0a91484fa0
4 changed files with 7 additions and 10 deletions
|
@ -92,7 +92,7 @@ class Apps extends BaseApi
|
|||
}
|
||||
|
||||
if (!DBA::insert('application', $fields)) {
|
||||
DI::mstdnError()->InternalError();
|
||||
$this->logErrorAndJsonExit(500, $this->errorFactory->InternalError());
|
||||
}
|
||||
|
||||
$this->jsonExit(DI::mstdnApplication()->createFromApplicationId(DBA::lastInsertId())->toArray());
|
||||
|
|
|
@ -45,7 +45,7 @@ class Lists extends BaseApi
|
|||
}
|
||||
|
||||
if (!Circle::remove($this->parameters['id'])) {
|
||||
DI::mstdnError()->InternalError();
|
||||
$this->logErrorAndJsonExit(500, $this->errorFactory->InternalError());
|
||||
}
|
||||
|
||||
$this->jsonExit([]);
|
||||
|
@ -68,7 +68,7 @@ class Lists extends BaseApi
|
|||
|
||||
$id = Circle::getIdByName($uid, $request['title']);
|
||||
if (!$id) {
|
||||
DI::mstdnError()->InternalError();
|
||||
$this->logErrorAndJsonExit(500, $this->errorFactory->InternalError());
|
||||
}
|
||||
|
||||
$this->jsonExit(DI::mstdnList()->createFromCircleId($id));
|
||||
|
|
|
@ -297,7 +297,7 @@ class Statuses extends BaseApi
|
|||
$item['uri'] = Item::newURI($item['guid']);
|
||||
$id = Post\Delayed::add($item['uri'], $item, Worker::PRIORITY_HIGH, Post\Delayed::PREPARED, DateTimeFormat::utc($request['scheduled_at']));
|
||||
if (empty($id)) {
|
||||
DI::mstdnError()->InternalError();
|
||||
$this->logErrorAndJsonExit(500, $this->errorFactory->InternalError());
|
||||
}
|
||||
$this->jsonExit(DI::mstdnScheduledStatus()->createFromDelayedPostId($id, $uid)->toArray());
|
||||
}
|
||||
|
@ -310,7 +310,7 @@ class Statuses extends BaseApi
|
|||
}
|
||||
}
|
||||
|
||||
DI::mstdnError()->InternalError();
|
||||
$this->logErrorAndJsonExit(500, $this->errorFactory->InternalError());
|
||||
}
|
||||
|
||||
protected function delete(array $request = [])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue