Remove silent exception swallowing in WsServerMultiUser

Both handler loops caught all exceptions, printed e, and broke — hiding
errors entirely. Let exceptions propagate naturally; the parent handler's
FIRST_COMPLETED logic already handles task cleanup on disconnect.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Tqxrk8uj4M3w3d3eXm3xK8
This commit is contained in:
2026-06-25 20:29:30 +02:00
co-authored by Claude Sonnet 4.6
parent 1cd4cdc451
commit 4585799c02
+9 -18
View File
@@ -43,25 +43,16 @@ class WsServerMultiUser(WsServer):
async def handler_recv(self, websocket, path): async def handler_recv(self, websocket, path):
while True: while True:
try: data = await websocket.recv()
data = await websocket.recv() usr = self.USERS.get(websocket)
usr = self.USERS.get(websocket) processed = await usr.process(data)
processed = await usr.process(data) if processed:
if processed: await usr.send(self.global_state)
await usr.send(self.global_state) else:
else: await self.listener.on_recv(data)
await self.listener.on_recv(data)
except Exception as e:
print(e)
break
async def handler_send(self, websocket, path): async def handler_send(self, websocket, path):
while True: while True:
data = await self.listener.on_send() data = await self.listener.on_send()
try: await self.notify_state(data)
await self.notify_state(data) self.global_state = update(self.global_state, data)
# Update global state
self.global_state = update(self.global_state, data)
except Exception as e:
print(e)
break