X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FApi%2FMastodon%2FAccounts.php;h=6b88b84ef3fac571fc365743abdfbd1e8888cda8;hb=7486ebdc10715b7204b70ce262052d28cb61c69e;hp=043d94b6da40b8a7f91ef692a5e6be9782f6579d;hpb=5aad46c7fb2b66d63ad93d92ee355fc522b57be1;p=friendica.git diff --git a/src/Module/Api/Mastodon/Accounts.php b/src/Module/Api/Mastodon/Accounts.php index 043d94b6da..6b88b84ef3 100644 --- a/src/Module/Api/Mastodon/Accounts.php +++ b/src/Module/Api/Mastodon/Accounts.php @@ -1,6 +1,6 @@ parameters['id']) && empty($this->parameters['name'])) { - DI::mstdnError()->UnprocessableEntity(); + $this->logErrorAndJsonExit(422, $this->errorFactory->UnprocessableEntity()); } if (!empty($this->parameters['id'])) { $id = $this->parameters['id']; if (!DBA::exists('contact', ['id' => $id, 'uid' => 0])) { - DI::mstdnError()->RecordNotFound(); + $this->logErrorAndJsonExit(404, $this->errorFactory->RecordNotFound()); } } else { $contact = Contact::selectFirst(['id'], ['nick' => $this->parameters['name'], 'uid' => 0]); if (!empty($contact['id'])) { $id = $contact['id']; } elseif (!($id = Contact::getIdForURL($this->parameters['name'], 0, false))) { - DI::mstdnError()->RecordNotFound(); + $this->logErrorAndJsonExit(404, $this->errorFactory->RecordNotFound()); } } $account = DI::mstdnAccount()->createFromContactId($id, $uid); - System::jsonExit($account); + $this->jsonExit($account); } }