From e5962cfdc38b5132121e35dd2a016dcf92fc1b88 Mon Sep 17 00:00:00 2001 From: blankie Date: Wed, 24 Aug 2022 21:42:40 +0700 Subject: [PATCH] General fixes --- .gitignore | 1 + redditbot.py | 8 +++----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 6464013..1522b16 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ config.yaml redditbot.session* +redditbot.json diff --git a/redditbot.py b/redditbot.py index 05c76df..199e1dd 100644 --- a/redditbot.py +++ b/redditbot.py @@ -172,10 +172,8 @@ async def main(): except asyncio.TimeoutError: give_ups.add(unique_id) logging.error('%s timed out', chat) - for i in bot_admins: - await client.send_message(i, f'{chat} timed out') - break - except BaseException: + return + except Exception: give_ups.add(unique_id) logging.exception(chat) for i in bot_admins: @@ -186,7 +184,7 @@ async def main(): random_post, cpp = result try: await _actual_start_post(random_post, [chat], cpp, show_nsfw_warning, show_spoilers_warning) - except BaseException: + except Exception: logging.exception(random_post.id) for i in bot_admins: await client.send_message(i, f'{random_post.id}\n{traceback.format_exc()}', parse_mode=None)