diff --git a/Http/HttpResponsesToException.php b/Http/HttpResponsesToException.php index 382eaed..a2b103d 100644 --- a/Http/HttpResponsesToException.php +++ b/Http/HttpResponsesToException.php @@ -21,6 +21,7 @@ use Apisearch\Exception\InvalidTokenException; use Apisearch\Exception\ResourceExistsException; use Apisearch\Exception\ResourceNotAvailableException; +use Apisearch\Exception\TooManyRequestsException; /** * Class HttpResponsesToException. @@ -57,6 +58,8 @@ protected static function throwTransportableExceptionIfNeeded( throw new ResourceExistsException($response['body']['message']); case ForbiddenException::getTransportableHTTPError(): throw new ForbiddenException($response['body']['message']); + case TooManyRequestsException::getTransportableHTTPError(); + throw new TooManyRequestsException($response['body']['message']); case ConnectionException::getTransportableHTTPError(): throw new ConnectionException('Apisearch returned an internal error code [500] - ' . $response['body']['message']); }