mirror of
https://github.com/onyx-and-iris/obsws-python.git
synced 2024-11-22 04:40:53 +00:00
log errors raised in authenticate()
This commit is contained in:
parent
126e5cb0a4
commit
5462c47b65
@ -7,7 +7,7 @@ from websocket import WebSocketTimeoutException
|
|||||||
|
|
||||||
from .baseclient import ObsClient
|
from .baseclient import ObsClient
|
||||||
from .callback import Callback
|
from .callback import Callback
|
||||||
from .error import OBSSDKTimeoutError
|
from .error import OBSSDKError, OBSSDKTimeoutError
|
||||||
from .subs import Subs
|
from .subs import Subs
|
||||||
|
|
||||||
"""
|
"""
|
||||||
@ -27,9 +27,14 @@ class EventClient:
|
|||||||
defaultkwargs = {"subs": Subs.LOW_VOLUME}
|
defaultkwargs = {"subs": Subs.LOW_VOLUME}
|
||||||
kwargs = defaultkwargs | kwargs
|
kwargs = defaultkwargs | kwargs
|
||||||
self.base_client = ObsClient(**kwargs)
|
self.base_client = ObsClient(**kwargs)
|
||||||
auth_status = self.base_client.authenticate()
|
try:
|
||||||
if auth_status:
|
success = self.base_client.authenticate()
|
||||||
self.logger.info(f"Successfully identified {self} with the server using rpcVersion:{auth_status['d']['negotiatedRpcVersion']}")
|
self.logger.info(
|
||||||
|
f"Successfully identified {self} with the server using RPC version:{success['negotiatedRpcVersion']}"
|
||||||
|
)
|
||||||
|
except OBSSDKError as e:
|
||||||
|
self.logger.error(f"{type(e).__name__}: {e}")
|
||||||
|
raise
|
||||||
self.callback = Callback()
|
self.callback = Callback()
|
||||||
self.subscribe()
|
self.subscribe()
|
||||||
|
|
||||||
|
@ -17,9 +17,14 @@ class ReqClient:
|
|||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
self.logger = logger.getChild(self.__class__.__name__)
|
self.logger = logger.getChild(self.__class__.__name__)
|
||||||
self.base_client = ObsClient(**kwargs)
|
self.base_client = ObsClient(**kwargs)
|
||||||
auth_status = self.base_client.authenticate()
|
try:
|
||||||
if auth_status:
|
success = self.base_client.authenticate()
|
||||||
self.logger.info(f"Successfully identified {self} with the server using rpcVersion:{auth_status['d']['negotiatedRpcVersion']}")
|
self.logger.info(
|
||||||
|
f"Successfully identified {self} with the server using RPC version:{success['negotiatedRpcVersion']}"
|
||||||
|
)
|
||||||
|
except OBSSDKError as e:
|
||||||
|
self.logger.error(f"{type(e).__name__}: {e}")
|
||||||
|
raise
|
||||||
|
|
||||||
def __enter__(self):
|
def __enter__(self):
|
||||||
return self
|
return self
|
||||||
|
Loading…
Reference in New Issue
Block a user