File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -193,21 +193,21 @@ async def ws_read_loop(self):
193193 try :
194194 async for raw in self .websocket :
195195 # Decode based on format
196- msg = self . decode_raw_websocket_frame ( raw )
197- if msg is not None :
196+ try :
197+ msg = self . decode_raw_websocket_frame ( raw )
198198 task = asyncio .create_task (self .on_protocol_message (msg ))
199199 task .add_done_callback (self .on_protcol_message_handled )
200+ except Exception as e :
201+ log .exception (
202+ f"WebSocketTransport.decode(): Unexpected exception handing channel message: { e } "
203+ )
200204 except ConnectionClosedOK :
201205 return
202206
203207 def decode_raw_websocket_frame (self , raw : str | bytes ) -> dict :
204- try :
205- if self .format == 'msgpack' :
206- return msgpack .unpackb (raw )
207- return json .loads (raw )
208- except Exception as e :
209- log .exception (f"WebSocketTransport.decode(): Unexpected exception handing channel message: { e } " )
210- return None
208+ if self .format == 'msgpack' :
209+ return msgpack .unpackb (raw )
210+ return json .loads (raw )
211211
212212 def on_protcol_message_handled (self , task ):
213213 try :
You can’t perform that action at this time.
0 commit comments