base error class added

readme updated

patch bump
This commit is contained in:
onyx-and-iris 2023-08-19 21:59:14 +01:00
parent 6e13e71a09
commit 822bdfb60d
4 changed files with 11 additions and 6 deletions

View File

@ -88,6 +88,7 @@ def on_twitch_event(event, data):
### Errors ### Errors
- `SteamlabsSIOError`: Base StreamlabsSIO error class
- `SteamlabsSIOConnectionError`: Exception raised when connection errors occur - `SteamlabsSIOConnectionError`: Exception raised when connection errors occur
### Logging ### Logging

View File

@ -1,6 +1,6 @@
[tool.poetry] [tool.poetry]
name = "streamlabsio" name = "streamlabsio"
version = "1.1.0" version = "1.1.1"
description = "Get real time Twitch/Youtube events through Streamlabs SocketIO API" description = "Get real time Twitch/Youtube events through Streamlabs SocketIO API"
authors = ["onyx-and-iris <code@onyxandiris.online>"] authors = ["onyx-and-iris <code@onyxandiris.online>"]
license = "MIT" license = "MIT"

View File

@ -46,12 +46,12 @@ class Client:
self.log_mode() self.log_mode()
def log_mode(self): 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: if self.raw:
INFO_MSG += ("raw JSON messages will be passed to callbacks",) info += ("raw JSON messages will be passed to callbacks",)
else: else:
INFO_MSG += ("event data objects will be passed to callbacks",) info += ("event data objects will be passed to callbacks",)
self.logger.info(" ".join(INFO_MSG)) self.logger.info(" ".join(info))
def _token_from_toml(self) -> str: def _token_from_toml(self) -> str:
try: try:

View File

@ -1,2 +1,6 @@
class SteamlabsSIOConnectionError(Exception): class SteamlabsSIOError(Exception):
"""Base StreamlabsSIO error class"""
class SteamlabsSIOConnectionError(SteamlabsSIOError):
"""Exception raised when connection errors occur""" """Exception raised when connection errors occur"""