mirror of
https://github.com/friendica/friendica
synced 2025-04-27 12:30:11 +00:00
Move jsonError out of Factory\Api\Mastodon\Error->RecordNotFound
This commit is contained in:
parent
9e71610711
commit
7f846f153d
36 changed files with 68 additions and 56 deletions
|
@ -50,14 +50,11 @@ class Error extends BaseFactory
|
|||
$this->logger->info('API Error', ['no' => $errorno, 'error' => $error, 'method' => $this->args->getMethod(), 'command' => $this->args->getQueryString(), 'user-agent' => $this->server['HTTP_USER_AGENT'] ?? '']);
|
||||
}
|
||||
|
||||
public function RecordNotFound()
|
||||
public function RecordNotFound(): \Friendica\Object\Api\Mastodon\Error
|
||||
{
|
||||
$error = $this->l10n->t('Record not found');
|
||||
$error_description = '';
|
||||
$errorObj = new \Friendica\Object\Api\Mastodon\Error($error, $error_description);
|
||||
|
||||
$this->logError(404, $error);
|
||||
$this->jsonError(404, $errorObj->toArray());
|
||||
return new \Friendica\Object\Api\Mastodon\Error($error, $error_description);
|
||||
}
|
||||
|
||||
public function UnprocessableEntity(string $error = '')
|
||||
|
|
|
@ -359,7 +359,7 @@ class Status extends BaseFactory
|
|||
{
|
||||
$item = ActivityPub\Transmitter::getItemArrayFromMail($id, true);
|
||||
if (empty($item)) {
|
||||
$this->mstdnErrorFactory->RecordNotFound();
|
||||
throw new HTTPException\NotFoundException('Mail record not found with id: ' . $id);
|
||||
}
|
||||
|
||||
$account = $this->mstdnAccountFactory->createFromContactId($item['author-id']);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue