1
0
mirror of https://github.com/chylex/Nextcloud-News.git synced 2025-04-25 20:15:47 +02:00

Smarter error logging

Signed-off-by: Benjamin Brahmer <info@b-brahmer.de>

Co-authored-by: Sean Molenaar <SMillerDev@users.noreply.github.com>
This commit is contained in:
Benjamin Brahmer 2021-10-17 15:16:25 +02:00
parent 74586396f8
commit 137af71bb3

View File

@ -377,22 +377,13 @@ class FeedFetcher implements IFeedFetcher
]
);
} catch (RequestException $e) {
if ($e->hasResponse()) {
$this->logger->info(
'An error occurred while trying to download the feed logo of {url}: {error}',
[
'url' => $url,
'error' => $e->getResponse()
'error' => $e->getResponse() ?? 'Unknown'
]
);
} else {
$this->logger->info(
'An unknown error occurred while trying to download the feed logo of {url}.',
[
'url' => $url,
]
);
}
}
$is_image = $downloaded && substr(mime_content_type($favicon_path), 0, 5) === "image";