gs: more error catching
This commit is contained in:
parent
5beb79b51b
commit
3cda1316ae
@ -209,6 +209,7 @@ async def new_boat(boatId, name, ws):
|
||||
async def run(ws, path):
|
||||
"""hadeler for every new websocket connection"""
|
||||
client = None
|
||||
try:
|
||||
async for msg in ws:
|
||||
for message in msg.split("\n"):
|
||||
if len(message) == 0:
|
||||
@ -249,6 +250,8 @@ async def run(ws, path):
|
||||
print("INFO: boat " + client['id'] + ": disconnected")
|
||||
client['state'] = "terminated"
|
||||
break
|
||||
except websockets.exceptions.ConnectionClosed:
|
||||
print("INFO: connection disconected")
|
||||
|
||||
async def main():
|
||||
"""main"""
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user