From 1f18b5053c44d418e3059a789cb9bdf40f3f9b10 Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Mon, 2 Nov 2020 00:03:20 +0100 Subject: also add the JoinError exception type Signed-off-by: Olivier Gayot --- swiftstory/SwiftStory.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'swiftstory/SwiftStory.py') diff --git a/swiftstory/SwiftStory.py b/swiftstory/SwiftStory.py index b81b0c3..17d88fe 100644 --- a/swiftstory/SwiftStory.py +++ b/swiftstory/SwiftStory.py @@ -8,7 +8,7 @@ import logging import websockets import swiftstory.GameManager -from swiftstory.exception import WrongAction +from swiftstory.exception import WrongAction, JoinError from swiftstory.Client import Client from swiftstory.Status import error @@ -65,6 +65,9 @@ def message_received_handler(client, message): return error('invalid command') except WrongAction as e: return error(str(e)) + except JoinError as e: + logging.warning("player could not join game: %s", e.__repr__()) + return error(str(e)) async def connection_handler(websocket, path): -- cgit v1.2.3