From 9687a2e45fabd1c58d79cede122088ad3c4918ce Mon Sep 17 00:00:00 2001 From: Justijn Depover Date: Wed, 31 Mar 2021 16:06:04 +0200 Subject: [PATCH] throw error with correct code --- src/Exceptions/ApiException.php | 2 +- src/Exceptions/CouldNotAquireAccessTokenException.php | 2 +- src/Exceptions/NoAccessToScopeException.php | 2 +- src/Exceptions/TooManyRequestsException.php | 2 +- src/Exceptions/UnauthorizedException.php | 2 +- src/Exceptions/UnknownResourceException.php | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Exceptions/ApiException.php b/src/Exceptions/ApiException.php index d18c724..120127e 100644 --- a/src/Exceptions/ApiException.php +++ b/src/Exceptions/ApiException.php @@ -8,6 +8,6 @@ class ApiException extends Exception { public static function make(string $code, string $message): self { - return new static("Error $code: $message"); + return new static("Error $code: $message", $code); } } \ No newline at end of file diff --git a/src/Exceptions/CouldNotAquireAccessTokenException.php b/src/Exceptions/CouldNotAquireAccessTokenException.php index ce17cb4..6132d44 100644 --- a/src/Exceptions/CouldNotAquireAccessTokenException.php +++ b/src/Exceptions/CouldNotAquireAccessTokenException.php @@ -8,6 +8,6 @@ class CouldNotAquireAccessTokenException extends Exception { public static function make(string $code, string $message): self { - return new static("Error $code: Could not aquire or refresh access token: $message"); + return new static("Error $code: Could not aquire or refresh access token: $message", $code); } } \ No newline at end of file diff --git a/src/Exceptions/NoAccessToScopeException.php b/src/Exceptions/NoAccessToScopeException.php index 924ed7d..7095801 100644 --- a/src/Exceptions/NoAccessToScopeException.php +++ b/src/Exceptions/NoAccessToScopeException.php @@ -8,6 +8,6 @@ class NoAccessToScopeException extends Exception { public static function make(string $code, string $message): self { - return new static("Error $code: $message"); + return new static("Error $code: $message", $code); } } \ No newline at end of file diff --git a/src/Exceptions/TooManyRequestsException.php b/src/Exceptions/TooManyRequestsException.php index fffe2eb..752c494 100644 --- a/src/Exceptions/TooManyRequestsException.php +++ b/src/Exceptions/TooManyRequestsException.php @@ -8,6 +8,6 @@ class TooManyRequestsException extends Exception { public static function make(string $code, string $message): self { - return new static("Error $code: $message"); + return new static("Error $code: $message", $code); } } \ No newline at end of file diff --git a/src/Exceptions/UnauthorizedException.php b/src/Exceptions/UnauthorizedException.php index 3c2a11d..3cfa1ba 100644 --- a/src/Exceptions/UnauthorizedException.php +++ b/src/Exceptions/UnauthorizedException.php @@ -8,6 +8,6 @@ class UnauthorizedException extends Exception { public static function make(string $code, string $message): self { - return new static("Error $code: $message"); + return new static("Error $code: $message", $code); } } \ No newline at end of file diff --git a/src/Exceptions/UnknownResourceException.php b/src/Exceptions/UnknownResourceException.php index 3ed3ac7..7d163ba 100644 --- a/src/Exceptions/UnknownResourceException.php +++ b/src/Exceptions/UnknownResourceException.php @@ -8,6 +8,6 @@ class UnknownResourceException extends Exception { public static function make(string $code, string $message): self { - return new static("Error $code: $message"); + return new static("Error $code: $message", $code); } } \ No newline at end of file