From 0d7f67d721ec3b7be25fcf35842ac8328df83d37 Mon Sep 17 00:00:00 2001 From: Schimon Jehudah Date: Mon, 22 Jan 2024 15:01:52 +0000 Subject: [PATCH] Fix handling of document error --- slixfeed/config.py | 2 +- slixfeed/task.py | 1 - slixfeed/xmpp/process.py | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/slixfeed/config.py b/slixfeed/config.py index f3ec3cc..2eb2fac 100644 --- a/slixfeed/config.py +++ b/slixfeed/config.py @@ -200,7 +200,7 @@ def get_default_config_directory(): Returns ------- str - Path to configueation directory. + Path to configuration directory. """ # config_home = xdg.BaseDirectory.xdg_config_home config_home = os.environ.get('XDG_CONFIG_HOME') diff --git a/slixfeed/task.py b/slixfeed/task.py index 2943096..d3cd304 100644 --- a/slixfeed/task.py +++ b/slixfeed/task.py @@ -340,7 +340,6 @@ async def send_status(self, jid): db_file, "feeds") # print(await current_time(), jid, "has", feeds, "feeds") if not feeds: - print(">>> not feeds:", feeds, "jid:", jid) status_mode = "available" status_text = ( "📪️ Send a URL from a blog or a news website" diff --git a/slixfeed/xmpp/process.py b/slixfeed/xmpp/process.py index a0b2697..5653223 100644 --- a/slixfeed/xmpp/process.py +++ b/slixfeed/xmpp/process.py @@ -510,11 +510,11 @@ async def message(self, message): title + "_" + timestamp() + "." + ext) error = action.generate_document( data, url, ext, filename) - if status: + if error or status: response = ( "Failed to export {}. Reason: {}" ).format(ext.upper(), error) - elif not error: + else: url = await upload.start(self, jid, filename) await send_oob_message(self, jid, url) else: