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)