aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Mark <[email protected]>2021-01-29 14:34:02 -0800
committerGravatar GitHub <[email protected]>2021-01-29 14:34:02 -0800
commit1db6f1d1384c7f27fa205ebe216de4552a703d30 (patch)
tree81e9d17831504aeac4f323ea42f377805292ded9
parentMerge pull request #1358 from python-discord/trashcan-mods (diff)
parentRemove 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.py8
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.