From 783337b7386331226646af586dd9a2bd6b738ae2 Mon Sep 17 00:00:00 2001 From: ks129 <45097959+ks129@users.noreply.github.com> Date: Wed, 8 Apr 2020 12:55:34 +0300 Subject: (Minesweeper): Renamed user not playing error handler, changed `error` type hint from `typing.Any` to `Exception`, changed handling `KeyError` to handling `UserNotPlayingError`. --- bot/exts/evergreen/minesweeper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bot/exts/evergreen/minesweeper.py') diff --git a/bot/exts/evergreen/minesweeper.py b/bot/exts/evergreen/minesweeper.py index f08bad6f..4426f0c9 100644 --- a/bot/exts/evergreen/minesweeper.py +++ b/bot/exts/evergreen/minesweeper.py @@ -286,9 +286,9 @@ class Minesweeper(commands.Cog): @reveal_command.error @end_command.error - async def keyerror_handler(self, ctx: commands.Context, error: typing.Any) -> None: + async def user_not_playing_handler(self, ctx: commands.Context, error: Exception) -> None: """Handle `KeyError` that is raised in reveal or end command when getting game.""" - if isinstance(error, KeyError): + if isinstance(error, UserNotPlayingError): await ctx.send("Game don't exist.") -- cgit v1.2.3