Skip to content

Commit a7eb45b

Browse files
committed
handle 429
1 parent faef34e commit a7eb45b

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/Client.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Developerayo\FireblocksLaravel\Exceptions\NotFoundException;
1616
use Developerayo\FireblocksLaravel\Exceptions\ConflictException;
1717
use Developerayo\FireblocksLaravel\Exceptions\UnprocessableEntityException;
18+
use Developerayo\FireblocksLaravel\Exceptions\RateLimitException;
1819
use Developerayo\FireblocksLaravel\Exceptions\ServiceException;
1920

2021
class Client
@@ -225,6 +226,8 @@ private function handleApiError(int $statusCode, string $body, array $headers):
225226
throw new ConflictException($body, $statusCode, $errorData, $headers);
226227
case 422:
227228
throw new UnprocessableEntityException($body, $statusCode, $errorData, $headers);
229+
case 429:
230+
throw new RateLimitException($body, $statusCode, $errorData, $headers);
228231
default:
229232
if ($statusCode >= 500 && $statusCode <= 599) {
230233
throw new ServiceException($body, $statusCode, $errorData, $headers);

src/Exceptions/FireblocksException.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,5 @@ class ForbiddenException extends ApiException {}
4141
class NotFoundException extends ApiException {}
4242
class ConflictException extends ApiException {}
4343
class UnprocessableEntityException extends ApiException {}
44+
class RateLimitException extends ApiException {}
4445
class ServiceException extends ApiException {}

0 commit comments

Comments
 (0)