From f5ab758074a36cd63e56854c36e3f27aaf923da2 Mon Sep 17 00:00:00 2001 From: Harmon Date: Wed, 18 Oct 2023 07:53:38 -0500 Subject: [PATCH] [Discord] Handle ServerDisconnectedError in Twitter task --- Discord/cogs/twitter.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Discord/cogs/twitter.py b/Discord/cogs/twitter.py index 97e7f60d9b..788590875d 100644 --- a/Discord/cogs/twitter.py +++ b/Discord/cogs/twitter.py @@ -12,6 +12,7 @@ import traceback import urllib.parse +import aiohttp from more_itertools import chunked import feedparser @@ -606,6 +607,9 @@ async def check_tweets(self): except discord.DiscordServerError as e: self.bot.print(f"Twitter Task Discord Server Error: {e}") await asyncio.sleep(60) + except aiohttp.ServerDisconnectedError: + # TODO: Log + await asyncio.sleep(1) except Exception as e: print("Exception in Twitter Task", file = sys.stderr) traceback.print_exception(