diff --git a/MultiClient.py b/MultiClient.py index cd9c997b..fd7cfa9a 100644 --- a/MultiClient.py +++ b/MultiClient.py @@ -410,7 +410,7 @@ async def snes_recv_loop(ctx : Context): print("Snes disconnected, type /snes to reconnect") except Exception as e: print("Lost connection to the snes, type /snes to reconnect") - if type(e) is not websockets.ConnectionClosed: + if not isinstance(e, websockets.WebSocketException): logging.exception(e) finally: socket, ctx.snes_socket = ctx.snes_socket, None @@ -561,7 +561,7 @@ async def server_loop(ctx : Context): print('Failed to connect to the multiworld server') except Exception as e: print('Lost connection to the multiworld server, type /connect to reconnect') - if type(e) is not websockets.ConnectionClosed: + if not isinstance(e, websockets.WebSocketException): logging.exception(e) finally: ctx.name = None diff --git a/MultiServer.py b/MultiServer.py index 9a2a1c92..cb753721 100644 --- a/MultiServer.py +++ b/MultiServer.py @@ -102,7 +102,7 @@ async def server(websocket, path, ctx : Context): args = msg[1] await process_client_cmd(ctx, client, cmd, args) except Exception as e: - if type(e) is not websockets.ConnectionClosed: + if not isinstance(e, websockets.WebSocketException): logging.exception(e) finally: await on_client_disconnected(ctx, client)