From 89f718ec72adfe0e7f67ae7e2b850960c5147889 Mon Sep 17 00:00:00 2001 From: Philipp Date: Fri, 20 Aug 2021 19:48:16 +0200 Subject: [PATCH] Use CurlResult for failed HTTPRequests (legacy usage) --- src/Network/HTTPRequest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Network/HTTPRequest.php b/src/Network/HTTPRequest.php index 72311ea19..3bc58c19b 100644 --- a/src/Network/HTTPRequest.php +++ b/src/Network/HTTPRequest.php @@ -224,7 +224,7 @@ class HTTPRequest implements IHTTPRequest if ($exception->hasResponse()) { return new GuzzleResponse($exception->getResponse(), $url, $exception->getCode(), $exception->getMessage()); } else { - return new GuzzleResponse(null, $url, $exception->getCode(), $exception->getMessage()); + return new CurlResult($url, '', ['http_code' => $exception->getCode()], $exception->getCode(), $exception->getMessage()); } } finally { $this->profiler->stopRecording();