aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts/evergreen/error_handler.py
diff options
context:
space:
mode:
authorGravatar William Da Silva <[email protected]>2020-12-29 01:15:03 -0500
committerGravatar GitHub <[email protected]>2020-12-29 01:15:03 -0500
commit52d626131527dfae3c100aab9a530bae928b0fff (patch)
tree8b09d5e4579924d8f1c7b9917cb2f04fdd54c29c /bot/exts/evergreen/error_handler.py
parentCapitalize "ID" in error message (diff)
parentMerge pull request #484 from WillDaSilva/omdb-to-tmdb (diff)
Merge branch 'master' into startup-channel-check
Diffstat (limited to 'bot/exts/evergreen/error_handler.py')
-rw-r--r--bot/exts/evergreen/error_handler.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/bot/exts/evergreen/error_handler.py b/bot/exts/evergreen/error_handler.py
index 459a2b2d..99af1519 100644
--- a/bot/exts/evergreen/error_handler.py
+++ b/bot/exts/evergreen/error_handler.py
@@ -9,7 +9,7 @@ from sentry_sdk import push_scope
from bot.constants import Colours, ERROR_REPLIES, NEGATIVE_REPLIES
from bot.utils.decorators import InChannelCheckFailure, InMonthCheckFailure
-from bot.utils.exceptions import BrandingError, UserNotPlayingError
+from bot.utils.exceptions import UserNotPlayingError
log = logging.getLogger(__name__)
@@ -42,8 +42,8 @@ class CommandErrorHandler(commands.Cog):
@commands.Cog.listener()
async def on_command_error(self, ctx: commands.Context, error: commands.CommandError) -> None:
"""Activates when a command opens an error."""
- if hasattr(ctx.command, 'on_error'):
- logging.debug("A command error occured but the command had it's own error handler.")
+ if getattr(error, 'handled', False):
+ logging.debug(f"Command {ctx.command} had its error already handled locally; ignoring.")
return
error = getattr(error, 'original', error)
@@ -57,10 +57,6 @@ class CommandErrorHandler(commands.Cog):
if isinstance(error, commands.CommandNotFound):
return
- if isinstance(error, BrandingError):
- await ctx.send(embed=self.error_embed(str(error)))
- return
-
if isinstance(error, (InChannelCheckFailure, InMonthCheckFailure)):
await ctx.send(embed=self.error_embed(str(error), NEGATIVE_REPLIES), delete_after=7.5)
return