mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-08 00:03:12 +08:00
Added logic to properly map all existing errors from v3 to v2 in the API
This commit is contained in:
@@ -12,13 +12,15 @@ class VerifyAuthenticationException extends RuntimeException implements ProblemD
|
||||
{
|
||||
use CommonProblemDetailsExceptionTrait;
|
||||
|
||||
public const TYPE = 'https://shlink.io/api/error/invalid-api-key';
|
||||
|
||||
public static function forInvalidApiKey(): self
|
||||
{
|
||||
$e = new self('Provided API key does not exist or is invalid.');
|
||||
|
||||
$e->detail = $e->getMessage();
|
||||
$e->title = 'Invalid API key';
|
||||
$e->type = 'INVALID_API_KEY';
|
||||
$e->type = self::TYPE;
|
||||
$e->status = StatusCodeInterface::STATUS_UNAUTHORIZED;
|
||||
|
||||
return $e;
|
||||
|
||||
Reference in New Issue
Block a user