1
0
Fork 0
mirror of synced 2024-06-13 16:24:47 +12:00

feat: address issues on init.php

This commit is contained in:
Christy Jacob 2022-08-14 11:05:25 +05:30
parent 5296e61d35
commit c6f0b14e92
3 changed files with 2 additions and 12 deletions

View file

@ -541,13 +541,6 @@ return [
'code' => 401,
],
/* Registry Errors */
Exception::LOGGER_NOT_SUPPORTED => [
'name' => Exception::LOGGER_NOT_SUPPORTED,
'description' => 'Logging provider not supported. Logging disabled.',
'code' => 500,
],
/** Mocks */
Exception::MOCK_INVALID_CONTENT_RANGE_HEADER => [
'name' => Exception::MOCK_INVALID_CONTENT_RANGE_HEADER,

View file

@ -448,7 +448,7 @@ $register->set('logger', function () {
}
if (!Logger::hasProvider($providerName)) {
throw new Exception(Exception::LOGGER_NOT_SUPPORTED);
throw new Exception(Exception::GENERAL_SERVER_ERROR, "Logging provider not supported. Logging is disabled");
}
$classname = '\\Utopia\\Logger\\Adapter\\' . \ucfirst($providerName);
@ -818,7 +818,7 @@ App::setResource('user', function ($mode, $project, $console, $request, $respons
try {
$payload = $jwt->decode($authJWT);
} catch (JWTException $error) {
throw new Exception(Exception::USER_JWT_INVALID);
throw new Exception(Exception::USER_JWT_INVALID, 'Failed to verify JWT. ' . $error->getMessage());
}
$jwtUserId = $payload['userId'] ?? '';

View file

@ -176,9 +176,6 @@ class Exception extends \Exception
public const DOMAIN_ALREADY_EXISTS = 'domain_already_exists';
public const DOMAIN_VERIFICATION_FAILED = 'domain_verification_failed';
/** Logger */
public const LOGGER_NOT_SUPPORTED = 'logger_not_supported';
/** Mocks */
public const MOCK_INVALID_CONTENT_RANGE_HEADER = 'mock_invalid_content_range_header';
public const MOCK_FIRST_CHUNK_CANNOT_HAVE_ID = 'mock_first_chunk_cannot_have_id';