PennyDreadfulMTG / Penny-Dreadful-Tools

A suite of tools for the Penny Dreadful MTGO community
https://pennydreadfulmagic.com
MIT License
40 stars 28 forks source link

!pdm doesn't handle PDM being down gracefully #6315

Open vorpal-buildbot opened 5 years ago

vorpal-buildbot commented 5 years ago
Traceback (most recent call last):
  File "/home/discord/Penny-Dreadful-Discord-Bot/discordbot/command.py", line 78, in handle_command
    await method(Commands, client=client, channel=message.channel, args=args, author=message.author)
  File "/home/discord/Penny-Dreadful-Discord-Bot/discordbot/command.py", line 579, in pdm
    await self.resources(self, channel, args, author)
  File "/home/discord/Penny-Dreadful-Discord-Bot/discordbot/command.py", line 636, in resources
    results.update(site_resources(args))
  File "/home/discord/Penny-Dreadful-Discord-Bot/discordbot/command.py", line 919, in site_resources
    sitemap = fetcher.sitemap()
  File "/home/discord/Penny-Dreadful-Discord-Bot/magic/fetcher.py", line 204, in sitemap
    return internal.fetch_json(decksite_url('/api/sitemap/'))['urls']
  File "/home/discord/Penny-Dreadful-Discord-Bot/shared/fetcher_internal.py", line 56, in fetch_json
    blob = fetch(url, character_encoding)
  File "/home/discord/Penny-Dreadful-Discord-Bot/shared/fetcher_internal.py", line 33, in fetch
    raise FetchException(f'Server returned a {response.status_code}')
shared.fetcher_internal.FetchException: Server returned a 500

Reported on Discord by Back_Alley_G#3571

tsutton commented 5 years ago

This was due to PDM being down. The bot should do something more useful for !pdm when the website is down, like just sa that the site is down.

bakert commented 5 years ago

I feel like pdm being down is an error so this is almost sensible. We don't want it to not log anything, I don't think? Could open a GitHub ticket AND say "pdm is down" instead of "failed to execute command blah de blah"?