From 822bdfb60dc536073d61084da3a0e84cb7ed206d Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Sat, 19 Aug 2023 21:59:14 +0100 Subject: [PATCH] base error class added readme updated patch bump --- README.md | 1 + pyproject.toml | 2 +- streamlabsio/client.py | 8 ++++---- streamlabsio/error.py | 6 +++++- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index d6da718..1cac8c5 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,7 @@ def on_twitch_event(event, data): ### Errors +- `SteamlabsSIOError`: Base StreamlabsSIO error class - `SteamlabsSIOConnectionError`: Exception raised when connection errors occur ### Logging diff --git a/pyproject.toml b/pyproject.toml index d555bea..c356d56 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "streamlabsio" -version = "1.1.0" +version = "1.1.1" description = "Get real time Twitch/Youtube events through Streamlabs SocketIO API" authors = ["onyx-and-iris "] license = "MIT" diff --git a/streamlabsio/client.py b/streamlabsio/client.py index 2ff478d..45488be 100644 --- a/streamlabsio/client.py +++ b/streamlabsio/client.py @@ -46,12 +46,12 @@ class Client: self.log_mode() def log_mode(self): - INFO_MSG = (f"Running client in {'raw' if self.raw else 'normal'} mode.",) + info = (f"Running client in {'raw' if self.raw else 'normal'} mode.",) if self.raw: - INFO_MSG += ("raw JSON messages will be passed to callbacks",) + info += ("raw JSON messages will be passed to callbacks",) else: - INFO_MSG += ("event data objects will be passed to callbacks",) - self.logger.info(" ".join(INFO_MSG)) + info += ("event data objects will be passed to callbacks",) + self.logger.info(" ".join(info)) def _token_from_toml(self) -> str: try: diff --git a/streamlabsio/error.py b/streamlabsio/error.py index 8cc512b..e060efd 100644 --- a/streamlabsio/error.py +++ b/streamlabsio/error.py @@ -1,2 +1,6 @@ -class SteamlabsSIOConnectionError(Exception): +class SteamlabsSIOError(Exception): + """Base StreamlabsSIO error class""" + + +class SteamlabsSIOConnectionError(SteamlabsSIOError): """Exception raised when connection errors occur"""