feat: address issues on init.php
This commit is contained in:
parent
5296e61d35
commit
c6f0b14e92
|
@ -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,
|
||||
|
|
|
@ -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'] ?? '';
|
||||
|
|
|
@ -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';
|
||||
|
|
Loading…
Reference in a new issue