We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0e1d8df commit 577cf58Copy full SHA for 577cf58
samples/3catchall/main.py
@@ -27,5 +27,8 @@ async def catch_websocket(ws:WebSocket, full_path: str):
27
input = { "full_path": full_path, "query": dict(ws._query_params), "headers": dict(ws._headers) }
28
await ws.send_text(f'new websocket connection: {input}')
29
while True:
30
- msg = await ws.receive_text()
31
- await ws.send_text(f'got: {msg}')
+ try:
+ msg = await ws.receive_text()
32
+ await ws.send_text(f'got: {msg}')
33
+ except:
34
+ break
0 commit comments