diff options
| author | 2020-07-31 22:26:59 -0700 | |
|---|---|---|
| committer | 2020-07-31 23:02:46 -0700 | |
| commit | b1a677cd0a64b2ad4da400a492d9d5157d558546 (patch) | |
| tree | 3c3614d9d829b5f0142abfa6843ab5d8ab62b8df | |
| parent | Decorators: optionally raise an exception if resource is locked (diff) | |
Send users an error message if command raises LockedResourceError
| -rw-r--r-- | bot/cogs/error_handler.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/bot/cogs/error_handler.py b/bot/cogs/error_handler.py index 233851e41..a9c6d50b7 100644 --- a/bot/cogs/error_handler.py +++ b/bot/cogs/error_handler.py @@ -9,6 +9,7 @@ from bot.api import ResponseCodeError from bot.bot import Bot from bot.constants import Channels from bot.converters import TagNameConverter +from bot.errors import LockedResourceError from bot.utils.checks import InWhitelistCheckFailure log = logging.getLogger(__name__) @@ -66,6 +67,8 @@ class ErrorHandler(Cog): elif isinstance(e, errors.CommandInvokeError): if isinstance(e.original, ResponseCodeError): await self.handle_api_error(ctx, e.original) + elif isinstance(e.original, LockedResourceError): + await ctx.send(f"{e.original} Please wait for it to finish and try again later.") else: await self.handle_unexpected_error(ctx, e.original) return # Exit early to avoid logging. |