Skip to content

Bot gets Very Sad when Discord API endpoint throws HTTP/5xx error #8

@dopeghoti

Description

@dopeghoti

Stack trace from stderr follows:

Unhandled exception in internal background task 'find_messages'.
Traceback (most recent call last):
  File "/home/ghoti/.local/lib/python3.7/site-packages/discord/ext/tasks/__init__.py", line 101, in _loop
    await self.coro(*args, **kwargs)
  File "./bot.py", line 240, in find_messages
    @bot.command( name='list', help='Report a list of everyone in the Database' )
  File "/home/ghoti/.local/lib/python3.7/site-packages/discord/iterators.py", line 308, in flatten
    data = await self._retrieve_messages(self.retrieve)
  File "/home/ghoti/.local/lib/python3.7/site-packages/discord/iterators.py", line 348, in _retrieve_messages_before_strategy
    data = await self.logs_from(self.channel.id, retrieve, before=before)
  File "/home/ghoti/.local/lib/python3.7/site-packages/discord/http.py", line 265, in request
    raise DiscordServerError(r, data)
discord.errors.DiscordServerError: 502 Bad Gateway (error code: 0): <!DOCTYPE html>

Looks like it may be an upstream issue in discord.py but I might just had to do some exception handling.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions