diff --git a/.gitignore b/.gitignore index 77b11fa..3172c3a 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ composer.lock phpunit.phar phpunit.xml modd.conf +.idea diff --git a/src/Api/HttpApi.php b/src/Api/HttpApi.php index ea42c60..4c3c469 100644 --- a/src/Api/HttpApi.php +++ b/src/Api/HttpApi.php @@ -85,6 +85,8 @@ abstract class HttpApi throw HttpClientException::unauthorized($response); case 402: throw HttpClientException::requestFailed($response); + case 403: + throw HttpClientException::forbidden($response); case 404: throw HttpClientException::notFound($response); case 413: diff --git a/src/Exception/HttpClientException.php b/src/Exception/HttpClientException.php index 85e6bd6..621077c 100644 --- a/src/Exception/HttpClientException.php +++ b/src/Exception/HttpClientException.php @@ -83,6 +83,11 @@ final class HttpClientException extends \RuntimeException implements Exception return new self('Payload too large, your total attachment size is too big.', 413, $response); } + public static function forbidden(ResponseInterface $response) + { + return new self('Forbidden', 403, $response); + } + public function getResponse(): ?ResponseInterface { return $this->response;