should the loader attempt to load an invalid toml config

log as error but allow the loader to continue

patch bump
This commit is contained in:
onyx-and-iris 2023-08-01 18:18:02 +01:00
parent bf77ded007
commit 6b79c091e8
2 changed files with 8 additions and 3 deletions

View File

@ -1,6 +1,6 @@
[tool.poetry]
name = "voicemeeter-api"
version = "2.3.6"
version = "2.3.7"
description = "A Python wrapper for the Voiceemeter API"
authors = ["onyx-and-iris <code@onyxandiris.online>"]
license = "MIT"

View File

@ -147,8 +147,13 @@ class Loader(metaclass=SingletonType):
self.logger.info(
f"config file with name {identifier} already in memory, skipping.."
)
return False
return
try:
self.parser = dataextraction_factory(data)
except tomllib.TOMLDecodeError as e:
ERR_MSG = (str(e), f"When attempting to load {identifier}.toml")
self.logger.error(f"{type(e).__name__}: {' '.join(ERR_MSG)}")
return
return True
def register(self, identifier, data=None):