Use CurlResult for failed HTTPRequests (legacy usage)

This commit is contained in:
Philipp Holzer 2021-08-20 19:48:16 +02:00
parent dee1899628
commit 89f718ec72
No known key found for this signature in database
GPG key ID: 9A28B7D4FF5667BD

View file

@ -224,7 +224,7 @@ class HTTPRequest implements IHTTPRequest
if ($exception->hasResponse()) { if ($exception->hasResponse()) {
return new GuzzleResponse($exception->getResponse(), $url, $exception->getCode(), $exception->getMessage()); return new GuzzleResponse($exception->getResponse(), $url, $exception->getCode(), $exception->getMessage());
} else { } else {
return new GuzzleResponse(null, $url, $exception->getCode(), $exception->getMessage()); return new CurlResult($url, '', ['http_code' => $exception->getCode()], $exception->getCode(), $exception->getMessage());
} }
} finally { } finally {
$this->profiler->stopRecording(); $this->profiler->stopRecording();