From 0499447db758b9d606fbc2188fccbd650f88dd1e Mon Sep 17 00:00:00 2001 From: Shin <2082119+shinsenter@users.noreply.github.com> Date: Mon, 8 Apr 2024 11:06:31 +0900 Subject: [PATCH] Update PendingRequest.php This commit fixes this error: ``` Call to undefined method Illuminate\Http\Client\ConnectionException::toException() ``` --- src/Illuminate/Http/Client/PendingRequest.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Illuminate/Http/Client/PendingRequest.php b/src/Illuminate/Http/Client/PendingRequest.php index b1264922c419..1a10ce9a22cb 100644 --- a/src/Illuminate/Http/Client/PendingRequest.php +++ b/src/Illuminate/Http/Client/PendingRequest.php @@ -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); }