summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBenjamin Brahmer <info@b-brahmer.de>2021-11-14 11:28:33 +0100
committerBenjamin Brahmer <info@b-brahmer.de>2021-11-14 20:16:16 +0100
commit9f3b63b5f986fe583a89226f8412e9e91f5f4ca2 (patch)
treea9f979f8273b4ab40bb02a85243c81fc68f797d5 /lib
parent2d5cb253211a701122c5d7884d7cb2961419401f (diff)
Catch network errors while fetching feed logos, fixes #1570
Signed-off-by: Benjamin Brahmer <info@b-brahmer.de>
Diffstat (limited to 'lib')
-rwxr-xr-xlib/Fetcher/FeedFetcher.php17
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/Fetcher/FeedFetcher.php b/lib/Fetcher/FeedFetcher.php
index 7423c66df..5b48070d5 100755
--- a/lib/Fetcher/FeedFetcher.php
+++ b/lib/Fetcher/FeedFetcher.php
@@ -20,6 +20,7 @@ use FeedIo\FeedInterface;
use FeedIo\FeedIo;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\RequestException;
+use GuzzleHttp\Exception\ConnectException;
use Net_URL2;
use OCP\IL10N;
@@ -376,14 +377,14 @@ class FeedFetcher implements IFeedFetcher
'logo' => $favicon
]
);
- } catch (RequestException $e) {
- $this->logger->info(
- 'An error occurred while trying to download the feed logo of {url}: {error}',
- [
- 'url' => $url,
- 'error' => $e->getResponse() ?? 'Unknown'
- ]
- );
+ } catch (RequestException | ConnectException $e) {
+ $this->logger->info(
+ 'An error occurred while trying to download the feed logo of {url}: {error}',
+ [
+ 'url' => $url,
+ 'error' => $e->getResponse() ?? 'Unknown'
+ ]
+ );
}
$is_image = $downloaded && substr(mime_content_type($favicon_path), 0, 5) === "image";