]> git.mxchange.org Git - friendica.git/commitdiff
Fixing https://github.com/friendica/friendica/issues/10473#issuecomment-903993836
authorPhilipp <admin@philipp.info>
Mon, 23 Aug 2021 18:09:37 +0000 (20:09 +0200)
committerPhilipp <admin@philipp.info>
Wed, 25 Aug 2021 12:22:42 +0000 (14:22 +0200)
src/Network/HTTPClient.php

index c90dbc89642816512dcdf239e65d98abc4d85095..d2ea596f16eb3421fb00715bf8fb039a31532338 100644 (file)
@@ -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();