I hate everything
This commit is contained in:
parent
9a23746c0c
commit
6e3aab988d
1 changed files with 3 additions and 3 deletions
|
@ -152,7 +152,7 @@ class Session(object):
|
||||||
if self.websocket is not None:
|
if self.websocket is not None:
|
||||||
try:
|
try:
|
||||||
await self.websocket.send(json.dumps({"kind": "DEACTIVATED"}))
|
await self.websocket.send(json.dumps({"kind": "DEACTIVATED"}))
|
||||||
except websockets.exceptions.ConnectionClosedError:
|
except websockets.exceptions.ConnectionClosed:
|
||||||
print(self.connection_id, "not sending DEACTIVATED as it's already closed")
|
print(self.connection_id, "not sending DEACTIVATED as it's already closed")
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -178,7 +178,7 @@ class Session(object):
|
||||||
try:
|
try:
|
||||||
await self.websocket.send(json.dumps({"kind": "DIED"}))
|
await self.websocket.send(json.dumps({"kind": "DIED"}))
|
||||||
await self.websocket.close(1008)
|
await self.websocket.close(1008)
|
||||||
except websockets.exceptions.ConnectionClosedError:
|
except websockets.exceptions.ConnectionClosed:
|
||||||
print(self.connection_id, "socket already closed, no died message")
|
print(self.connection_id, "socket already closed, no died message")
|
||||||
|
|
||||||
if self.connection_id in active_sessions:
|
if self.connection_id in active_sessions:
|
||||||
|
@ -326,7 +326,7 @@ class Session(object):
|
||||||
json.dumps({"kind": "ERROR", "error": "unknown_kind"})
|
json.dumps({"kind": "ERROR", "error": "unknown_kind"})
|
||||||
)
|
)
|
||||||
|
|
||||||
except websockets.exceptions.ConnectionClosedError:
|
except websockets.exceptions.ConnectionClosed:
|
||||||
print(self.connection_id, "WebSocket closed")
|
print(self.connection_id, "WebSocket closed")
|
||||||
await self.end()
|
await self.end()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue