Fix handling of document error

This commit is contained in:
Schimon Jehudah 2024-01-22 15:01:52 +00:00
parent 4c64870d8f
commit 0d7f67d721
3 changed files with 3 additions and 4 deletions

View file

@ -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')

View file

@ -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"

View file

@ -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: