Added excpetions.
This commit is contained in:
parent
1ecb595bee
commit
51cf3fb500
@ -116,10 +116,9 @@ class RPC:
|
|||||||
print("Error while receiving:", ex)
|
print("Error while receiving:", ex)
|
||||||
break
|
break
|
||||||
if msg.type == aiohttp.WSMsgType.CLOSED:
|
if msg.type == aiohttp.WSMsgType.CLOSED:
|
||||||
break
|
raise Exception("WebSocket closed.")
|
||||||
elif msg.type == aiohttp.WSMsgType.ERROR:
|
elif msg.type == aiohttp.WSMsgType.ERROR:
|
||||||
print("WebSocket error:", msg)
|
raise Exception("WebSocket error:", msg)
|
||||||
break
|
|
||||||
elif msg.type == aiohttp.WSMsgType.TEXT:
|
elif msg.type == aiohttp.WSMsgType.TEXT:
|
||||||
|
|
||||||
if self.current_call_id and not msg.json().get('callId') != self.current_call_id:
|
if self.current_call_id and not msg.json().get('callId') != self.current_call_id:
|
||||||
@ -134,5 +133,4 @@ class RPC:
|
|||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
raise Exception("Unexpected message type.")
|
raise Exception("Unexpected message type.")
|
||||||
print("huh")
|
|
||||||
return None
|
return None
|
||||||
|
Loading…
Reference in New Issue
Block a user