From 195e4a2e0dc2d007a753ab84ef24f77eaa2f3b79 Mon Sep 17 00:00:00 2001 From: Simon Marache Date: Fri, 14 Mar 2025 13:07:47 +0000 Subject: [PATCH] [plugin] NewsDownloader: do not discard RSS/Atom feed processing errors (#13413) --- plugins/newsdownloader.koplugin/main.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/newsdownloader.koplugin/main.lua b/plugins/newsdownloader.koplugin/main.lua index 523fef6eb..97670f7a9 100644 --- a/plugins/newsdownloader.koplugin/main.lua +++ b/plugins/newsdownloader.koplugin/main.lua @@ -344,7 +344,7 @@ function NewsDownloader:processFeedSource(url, credentials, limit, unsupported_f -- Check if we have a cached response first local cache = DownloadBackend:getCache() local cached_response = cache:check(url) - local ok, response + local ok, error, response local cookies = nil if credentials ~= nil then @@ -479,7 +479,7 @@ function NewsDownloader:processFeedSource(url, credentials, limit, unsupported_f -- Process the feeds accordingly. if is_atom then - ok = pcall(function() + ok, error = pcall(function() return self:processFeed( FEED_TYPE_ATOM, feeds, @@ -493,7 +493,7 @@ function NewsDownloader:processFeedSource(url, credentials, limit, unsupported_f ) end) elseif is_rss then - ok = pcall(function() + ok, error = pcall(function() return self:processFeed( FEED_TYPE_RSS, feeds, @@ -513,6 +513,7 @@ function NewsDownloader:processFeedSource(url, credentials, limit, unsupported_f if not ok or (not is_rss and not is_atom) then local error_message if not ok then + logger.err("NewsDownloader: Error processing feed", error) error_message = _("(Reason: Failed to download content)") elseif not is_rss then error_message = _("(Reason: Couldn't process RSS)")