Skip to content

Commit

Permalink
throw error with correct code
Browse files Browse the repository at this point in the history
  • Loading branch information
justijndepover committed Mar 31, 2021
1 parent 4b6ea0f commit 9687a2e
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Exceptions/ApiException.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
2 changes: 1 addition & 1 deletion src/Exceptions/CouldNotAquireAccessTokenException.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
2 changes: 1 addition & 1 deletion src/Exceptions/NoAccessToScopeException.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
2 changes: 1 addition & 1 deletion src/Exceptions/TooManyRequestsException.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
2 changes: 1 addition & 1 deletion src/Exceptions/UnauthorizedException.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
2 changes: 1 addition & 1 deletion src/Exceptions/UnknownResourceException.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

0 comments on commit 9687a2e

Please sign in to comment.