From 0cf4891362ff7726fa3505fd06e2336a72ed3271 Mon Sep 17 00:00:00 2001 From: Nikita Zarubin Date: Tue, 28 Jun 2022 12:46:49 +0300 Subject: [PATCH] main --- BaseClient.php | 4 ++++ exceptions/PublicApiBearerException.php | 10 ++++++++++ 2 files changed, 14 insertions(+) create mode 100644 exceptions/PublicApiBearerException.php diff --git a/BaseClient.php b/BaseClient.php index b781719..54d15a4 100644 --- a/BaseClient.php +++ b/BaseClient.php @@ -10,6 +10,7 @@ use GuzzleHttp\Utils; use nikserg\ItcomPublicApi\exceptions\InvalidJsonException; use nikserg\ItcomPublicApi\exceptions\NotFoundException; +use nikserg\ItcomPublicApi\exceptions\PublicApiBearerException; use nikserg\ItcomPublicApi\exceptions\PublicApiException; use nikserg\ItcomPublicApi\exceptions\PublicApiMalformedRequestException; use nikserg\ItcomPublicApi\exceptions\PublicApiMalformedRequestValidationException; @@ -502,6 +503,9 @@ protected function checkError(ResponseInterface $response): ResponseInterface case 'PublicApiMalformedRequestValidationException': $errorClass = PublicApiMalformedRequestValidationException::class; break; + case 'PublicApiBearerException': + $errorClass = PublicApiBearerException::class; + break; } throw new $errorClass($json['error']); } diff --git a/exceptions/PublicApiBearerException.php b/exceptions/PublicApiBearerException.php new file mode 100644 index 0000000..a3de145 --- /dev/null +++ b/exceptions/PublicApiBearerException.php @@ -0,0 +1,10 @@ +