diff options
| author | 2021-01-29 14:34:02 -0800 | |
|---|---|---|
| committer | 2021-01-29 14:34:02 -0800 | |
| commit | 1db6f1d1384c7f27fa205ebe216de4552a703d30 (patch) | |
| tree | 81e9d17831504aeac4f323ea42f377805292ded9 | |
| parent | Merge pull request #1358 from python-discord/trashcan-mods (diff) | |
| parent | Remove ConversionError from comment, as its now handled above. (diff) | |
Merge PR #1388 - gracefully handle non-existing infractions
| -rw-r--r-- | bot/exts/backend/error_handler.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/bot/exts/backend/error_handler.py b/bot/exts/backend/error_handler.py index b8bb3757f..ed7962b06 100644 --- a/bot/exts/backend/error_handler.py +++ b/bot/exts/backend/error_handler.py @@ -85,8 +85,14 @@ class ErrorHandler(Cog): else: await self.handle_unexpected_error(ctx, e.original) return # Exit early to avoid logging. + elif isinstance(e, errors.ConversionError): + if isinstance(e.original, ResponseCodeError): + await self.handle_api_error(ctx, e.original) + else: + await self.handle_unexpected_error(ctx, e.original) + return # Exit early to avoid logging. elif not isinstance(e, errors.DisabledCommand): - # ConversionError, MaxConcurrencyReached, ExtensionError + # MaxConcurrencyReached, ExtensionError await self.handle_unexpected_error(ctx, e) return # Exit early to avoid logging. |