Skip to content

Commit

Permalink
[Discord] Handle ServerDisconnectedError in Twitter task
Browse files Browse the repository at this point in the history
  • Loading branch information
Harmon758 committed Oct 18, 2023
1 parent a2fb83e commit f5ab758
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Discord/cogs/twitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import traceback
import urllib.parse

import aiohttp
from more_itertools import chunked
import feedparser

Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit f5ab758

Please sign in to comment.