mirror of
https://github.com/friendica/friendica
synced 2025-04-23 23:10:10 +00:00
Rename BaseApi->logErrorAndJsonExit to logAndJsonError to better match the functionality
- Also it's shorter and we're paying by the character
This commit is contained in:
parent
eb583330df
commit
1b9ec3a214
57 changed files with 128 additions and 128 deletions
|
@ -424,17 +424,17 @@ class BaseApi extends BaseModule
|
|||
|
||||
if (empty($token)) {
|
||||
$this->logger->notice('Empty application token');
|
||||
$this->logErrorAndJsonExit(403, $this->errorFactory->Forbidden());
|
||||
$this->logAndJsonError(403, $this->errorFactory->Forbidden());
|
||||
}
|
||||
|
||||
if (!isset($token[$scope])) {
|
||||
$this->logger->warning('The requested scope does not exist', ['scope' => $scope, 'application' => $token]);
|
||||
$this->logErrorAndJsonExit(403, $this->errorFactory->Forbidden());
|
||||
$this->logAndJsonError(403, $this->errorFactory->Forbidden());
|
||||
}
|
||||
|
||||
if (empty($token[$scope])) {
|
||||
$this->logger->warning('The requested scope is not allowed', ['scope' => $scope, 'application' => $token]);
|
||||
$this->logErrorAndJsonExit(403, $this->errorFactory->Forbidden());
|
||||
$this->logAndJsonError(403, $this->errorFactory->Forbidden());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -526,7 +526,7 @@ class BaseApi extends BaseModule
|
|||
* @return void
|
||||
* @throws HTTPException\InternalServerErrorException
|
||||
*/
|
||||
protected function logErrorAndJsonExit(int $errorno, Error $error)
|
||||
protected function logAndJsonError(int $errorno, Error $error)
|
||||
{
|
||||
$this->logger->info('API Error', ['no' => $errorno, 'error' => $error->toArray(), 'method' => $this->args->getMethod(), 'command' => $this->args->getQueryString(), 'user-agent' => $this->server['HTTP_USER_AGENT'] ?? '']);
|
||||
$this->jsonError(403, $error->toArray());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue