Skip to content

Commit

Permalink
Fix type error in retryHandler with ConnectException
Browse files Browse the repository at this point in the history
Since guzzle 7.0 the ConnectException no longer extends RequestException. 
This leads to type errors in the retry handler in case of connection exceptions.
Change the signature to GuzzleException to cover all possible cases
  • Loading branch information
ederuiter authored Sep 3, 2021
1 parent 71697e5 commit 66820b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ public function unwrap(array $promises): array
private function getRetryHandler(): Closure
{
return function ($retries, ?RequestInterface $request, ?ResponseInterface $response,
?RequestException $exception) {
?GuzzleException $exception) {
if (!$response || $response->getStatusCode() > 500 || ($exception && $exception instanceof ConnectException))
return false;

Expand Down

0 comments on commit 66820b7

Please sign in to comment.