mirror of
https://github.com/friendica/friendica
synced 2025-04-24 12:30:10 +00:00
Improved error reporting
This commit is contained in:
parent
d1e109d9be
commit
c22846339a
3 changed files with 20 additions and 12 deletions
|
@ -43,7 +43,7 @@ class Apps extends BaseApi
|
|||
$website = !isset($_REQUEST['website']) ? '' : $_REQUEST['website'];
|
||||
|
||||
if (empty($name) || empty($redirect)) {
|
||||
DI::mstdnError()->RecordNotFound();
|
||||
DI::mstdnError()->UnprocessableEntity(DI::l10n()->t('Missing parameters'));
|
||||
}
|
||||
|
||||
$client_id = bin2hex(random_bytes(32));
|
||||
|
@ -60,7 +60,7 @@ class Apps extends BaseApi
|
|||
}
|
||||
|
||||
if (!DBA::insert('application', $fields)) {
|
||||
DI::mstdnError()->RecordNotFound();
|
||||
DI::mstdnError()->InternalError();
|
||||
}
|
||||
|
||||
System::jsonExit(DI::mstdnApplication()->createFromApplicationId(DBA::lastInsertId()));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue