From 3d37d781d4bd299e17e4c58c6a85963747ac4762 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Debrauwer?= Date: Fri, 3 Nov 2023 15:23:36 +0100 Subject: [PATCH] Update PendingRequest.php (#48900) --- src/Illuminate/Http/Client/PendingRequest.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Illuminate/Http/Client/PendingRequest.php b/src/Illuminate/Http/Client/PendingRequest.php index cfab639cf511..ba910f833111 100644 --- a/src/Illuminate/Http/Client/PendingRequest.php +++ b/src/Illuminate/Http/Client/PendingRequest.php @@ -1008,6 +1008,10 @@ protected function makePromise(string $method, string $url, array $options = []) }); }) ->otherwise(function (TransferException $e) { + if ($e instanceof ConnectException) { + $this->dispatchConnectionFailedEvent(); + } + return $e instanceof RequestException && $e->hasResponse() ? $this->populateResponse($this->newResponse($e->getResponse())) : $e; }); }