Move Api\unsupported tests and remove dependency to System::jsonExit()

This commit is contained in:
Philipp 2021-11-12 22:44:59 +01:00
parent c0219fe2fa
commit e7f84d4934
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
5 changed files with 52 additions and 50 deletions

View file

@ -4,8 +4,6 @@ namespace Friendica\Module\Api;
use Friendica\App\Arguments;
use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Object\Api\Mastodon\Error;
use Friendica\Util\Arrays;
use Friendica\Util\HTTPInputData;
use Friendica\Util\XML;
@ -231,7 +229,7 @@ class ApiResponse
]);
$error = $this->l10n->t('API endpoint %s %s is not implemented', strtoupper($method), $path);
$error_description = $this->l10n->t('The API endpoint is currently not implemented but might be in the future.');
$errorobj = new Error($error, $error_description);
System::jsonError(501, $errorobj->toArray());
$this->exit('error', ['error' => ['error' => $error, 'error_description' => $error_description]]);
}
}