Skip to content

Commit 4c26433

Browse files
authored
Update PendingRequest.php (#50955)
This commit fixes this error: ``` Call to undefined method Illuminate\Http\Client\ConnectionException::toException() ```
1 parent 1cd4ecc commit 4c26433

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Illuminate/Http/Client/PendingRequest.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -1055,7 +1055,11 @@ protected function handlePromiseResponse(Response|ConnectionException|TransferEx
10551055
}
10561056

10571057
if ($attempt < $this->tries && $shouldRetry) {
1058-
$options['delay'] = value($this->retryDelay, $attempt, $response->toException());
1058+
$options['delay'] = value(
1059+
$this->retryDelay,
1060+
$attempt,
1061+
$response instanceof Response ? $response->toException() : $response
1062+
);
10591063

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

0 commit comments

Comments
 (0)