mirror of
https://github.com/onyx-and-iris/obsws-python.git
synced 2024-11-22 04:40:53 +00:00
raise OBSSDKError if auth reponse opcode != 2
This commit is contained in:
parent
4ced7193df
commit
126e5cb0a4
@ -108,9 +108,15 @@ class ObsClient:
|
||||
self.ws.send(json.dumps(payload))
|
||||
try:
|
||||
response = json.loads(self.ws.recv())
|
||||
return response
|
||||
if response["op"] != 2:
|
||||
raise OBSSDKError(
|
||||
"failed to identify client with the server, expected response with OpCode 2 Identified"
|
||||
)
|
||||
return response["d"]
|
||||
except json.decoder.JSONDecodeError:
|
||||
raise OBSSDKError("failed to identify client with the server")
|
||||
raise OBSSDKError(
|
||||
"failed to identify client with the server, please check connection settings"
|
||||
)
|
||||
|
||||
def req(self, req_type, req_data=None):
|
||||
payload = {
|
||||
|
Loading…
Reference in New Issue
Block a user