From 1a42f35a3cd857e53504e811569be306072139a2 Mon Sep 17 00:00:00 2001 From: Philipp Date: Fri, 9 Oct 2020 19:59:24 +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 798b0cdea8..e0400b6b94 100644 --- a/src/Network/HTTPRequest.php +++ b/src/Network/HTTPRequest.php @@ -195,7 +195,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->saveTimestamp($stamp1, 'network');