diff --git a/views/player.py b/views/player.py index f0a38de..25a46be 100644 --- a/views/player.py +++ b/views/player.py @@ -70,7 +70,10 @@ async def play_card_js(player_id, card_idx): msg = {"type": "message", "fct": "cardPlayed", "card": s, "card_idx": card_idx, "player": player_id, "num_players": len(the_game.players)} for ws in the_game.websockets: - await ws.send_json(msg) + try: + await ws.send_json(msg) + except Exception: + the_game.websockets.remove(ws) @api.route("/player/{player}/play/{card}")