Skip to content

Commit 068e5cb

Browse files
author
Chris Smith
committed
Added suppport for catching Guzzle ServerExceptions
1 parent a8d614d commit 068e5cb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/Clients/ApiClient.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use GuzzleHttp\Client as GuzzleClient;
66
use GuzzleHttp\Exception\ConnectException;
77
use GuzzleHttp\Exception\GuzzleException;
8+
use GuzzleHttp\Exception\ServerException;
89
use Throwable;
910
use Xedi\SendGrid\Clients\Concerns\HandlesExceptions;
1011
use Xedi\SendGrid\Clients\HttpResponse;
@@ -150,7 +151,7 @@ protected function makeRequest(
150151
$response->getStatusCode(),
151152
$response->getHeaders()
152153
);
153-
} catch (ConnectException $exception) {
154+
} catch (ConnectException | ServerException $exception) {
154155
throw SendGridUnreacheableException::fromConnectionException(
155156
$exception
156157
);

0 commit comments

Comments
 (0)