diff options
author | 2020-04-08 12:55:34 +0300 | |
---|---|---|
committer | 2020-04-08 12:55:34 +0300 | |
commit | 783337b7386331226646af586dd9a2bd6b738ae2 (patch) | |
tree | 97070bfdac9b23946685c0dd848bed34d1f70170 /bot/exts/evergreen/minesweeper.py | |
parent | (Minesweeper): Created new exception `UserNotPlayingError`. (diff) |
(Minesweeper): Renamed user not playing error handler, changed `error` type hint from `typing.Any` to `Exception`, changed handling `KeyError` to handling `UserNotPlayingError`.
Diffstat (limited to 'bot/exts/evergreen/minesweeper.py')
-rw-r--r-- | bot/exts/evergreen/minesweeper.py | 4 |
1 files changed, 2 insertions, 2 deletions
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.") |