aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts/evergreen/error_handler.py
diff options
context:
space:
mode:
authorGravatar kwzrd <[email protected]>2020-04-08 18:15:24 +0100
committerGravatar GitHub <[email protected]>2020-04-08 18:15:24 +0100
commit30b73caa8244d43a1d48a9a4e652543844bbad4d (patch)
tree6b3a80dfcd00fcdf442495a161cad9032d5bbcd0 /bot/exts/evergreen/error_handler.py
parentMerge pull request #392 from python-discord/fetch-devlog-channel (diff)
parent(Error Handler): Added `UserNotPlayingError` catching to error handler. (diff)
Merge pull request #396 from ks129/keyerrors-fix
* Add error handling for invalid APOD dates * Add error handling for non-existent minesweeper games
Diffstat (limited to 'bot/exts/evergreen/error_handler.py')
-rw-r--r--bot/exts/evergreen/error_handler.py6
1 files changed, 5 insertions, 1 deletions
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,