From 10e60894054fdba0908a22a4ba8395e436f1cff9 Mon Sep 17 00:00:00 2001 From: Philipp Date: Mon, 23 Aug 2021 20:09:37 +0200 Subject: [PATCH] Fixing https://github.com/friendica/friendica/issues/10473#issuecomment-903993836 --- src/Network/HTTPClient.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Network/HTTPClient.php b/src/Network/HTTPClient.php index c90dbc8964..d2ea596f16 100644 --- a/src/Network/HTTPClient.php +++ b/src/Network/HTTPClient.php @@ -31,6 +31,7 @@ use GuzzleHttp\Exception\TransferException; use GuzzleHttp\RequestOptions; use mattwright\URLResolver; use Psr\Http\Message\ResponseInterface; +use Psr\Log\InvalidArgumentException; use Psr\Log\LoggerInterface; /** @@ -146,6 +147,9 @@ class HTTPClient implements IHTTPClient } else { return new CurlResult($url, '', ['http_code' => $exception->getCode()], $exception->getCode(), ''); } + } catch (InvalidArgumentException $argumentException) { + $this->logger->info('Invalid Argument for HTTP call.', ['url' => $url, 'method' => $method, 'exception' => $argumentException]); + return new CurlResult($url, '', ['http_code' => $argumentException->getCode()], $argumentException->getCode(), $argumentException->getMessage()); } finally { $this->logger->debug('Request stop.', ['url' => $url, 'method' => $method]); $this->profiler->stopRecording();