Skip to content

Commit

Permalink
Update PendingRequest.php (#50955)
Browse files Browse the repository at this point in the history
This commit fixes this error:
```
Call to undefined method Illuminate\Http\Client\ConnectionException::toException()
```
  • Loading branch information
shinsenter committed Apr 8, 2024
1 parent 1cd4ecc commit 4c26433
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Illuminate/Http/Client/PendingRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,11 @@ protected function handlePromiseResponse(Response|ConnectionException|TransferEx
}

if ($attempt < $this->tries && $shouldRetry) {
$options['delay'] = value($this->retryDelay, $attempt, $response->toException());
$options['delay'] = value(
$this->retryDelay,
$attempt,
$response instanceof Response ? $response->toException() : $response
);

return $this->makePromise($method, $url, $options, $attempt + 1);
}
Expand Down

0 comments on commit 4c26433

Please sign in to comment.