From 56cacaef95215f6328e8da1237f73543e2d42320 Mon Sep 17 00:00:00 2001 From: ks129 <45097959+ks129@users.noreply.github.com> Date: Wed, 8 Apr 2020 20:03:27 +0300 Subject: (Error Handler): Added `UserNotPlayingError` catching to error handler. --- bot/exts/evergreen/error_handler.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'bot/exts/evergreen/error_handler.py') diff --git a/bot/exts/evergreen/error_handler.py b/bot/exts/evergreen/error_handler.py index 33b1a3f2..459a2b2d 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 +from bot.utils.exceptions import BrandingError, UserNotPlayingError log = logging.getLogger(__name__) @@ -103,6 +103,10 @@ class CommandErrorHandler(commands.Cog): await ctx.send(embed=self.error_embed("You are not authorized to use this command.", NEGATIVE_REPLIES)) return + if isinstance(error, UserNotPlayingError): + await ctx.send("Game not found.") + return + with push_scope() as scope: scope.user = { "id": ctx.author.id, -- cgit v1.2.3