handle all connection closed exceptions
This commit is contained in:
2
web.py
2
web.py
@@ -133,7 +133,7 @@ class ReticulumWebChat:
|
|||||||
message = await client.recv()
|
message = await client.recv()
|
||||||
data = json.loads(message)
|
data = json.loads(message)
|
||||||
await self.on_websocket_data_received(client, data)
|
await self.on_websocket_data_received(client, data)
|
||||||
except websockets.ConnectionClosedOK:
|
except (websockets.ConnectionClosed, websockets.ConnectionClosedOK, websockets.ConnectionClosedError):
|
||||||
# client disconnected, we can stop looping
|
# client disconnected, we can stop looping
|
||||||
break
|
break
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|||||||
Reference in New Issue
Block a user