Skip to content

Commit

Permalink
main
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita Zarubin committed Jun 28, 2022
1 parent 2d1888c commit 0cf4891
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions BaseClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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']);
}
Expand Down
10 changes: 10 additions & 0 deletions exceptions/PublicApiBearerException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace nikserg\ItcomPublicApi\exceptions;

/**
* Неправильный bearer-токен
*/
class PublicApiBearerException extends PublicApiException
{
}

0 comments on commit 0cf4891

Please sign in to comment.