Added excpetions.

This commit is contained in:
retoor 2025-02-15 13:23:46 +01:00
parent 1ecb595bee
commit 51cf3fb500

View File

@ -116,10 +116,9 @@ class RPC:
print("Error while receiving:", ex)
break
if msg.type == aiohttp.WSMsgType.CLOSED:
break
raise Exception("WebSocket closed.")
elif msg.type == aiohttp.WSMsgType.ERROR:
print("WebSocket error:", msg)
break
raise Exception("WebSocket error:", msg)
elif msg.type == aiohttp.WSMsgType.TEXT:
if self.current_call_id and not msg.json().get('callId') != self.current_call_id:
@ -134,5 +133,4 @@ class RPC:
break
else:
raise Exception("Unexpected message type.")
print("huh")
return None