handle all connection closed exceptions

This commit is contained in:
liamcottle
2024-04-30 21:04:43 +12:00
parent 09172415b0
commit d577fb135e

2
web.py
View File

@@ -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: