diff --git a/src/Illuminate/Http/Client/PendingRequest.php b/src/Illuminate/Http/Client/PendingRequest.php index ba910f833111..78e361feffad 100644 --- a/src/Illuminate/Http/Client/PendingRequest.php +++ b/src/Illuminate/Http/Client/PendingRequest.php @@ -23,6 +23,7 @@ use Illuminate\Support\Traits\Conditionable; use Illuminate\Support\Traits\Macroable; use JsonSerializable; +use OutOfBoundsException; use Psr\Http\Message\MessageInterface; use Psr\Http\Message\RequestInterface; use RuntimeException; @@ -1007,7 +1008,7 @@ protected function makePromise(string $method, string $url, array $options = []) $this->dispatchResponseReceivedEvent($response); }); }) - ->otherwise(function (TransferException $e) { + ->otherwise(function (OutOfBoundsException|TransferException $e) { if ($e instanceof ConnectException) { $this->dispatchConnectionFailedEvent(); }