Fix error handling in Core class when loading notifier classes

Previously, when loading notifier classes in the Core class, any error that occurred would simply log an error message without providing any details. This commit improves error handling by catching exceptions and logging the specific error message when loading a notifier class fails. This allows for better debugging and troubleshooting in the future.
This commit is contained in:
Kumi 2023-09-06 13:38:35 +02:00
parent e53a723188
commit 62227ec644
Signed by: kumi
GPG key ID: ECBCC9082395383F

View file

@ -44,8 +44,8 @@ class Core:
try:
module = importlib.import_module(f"trackbert.notifiers.{notifier.stem}")
except:
logging.error(f"Error loading class {notifier.stem}")
except Exception as e:
logging.error(f"Error loading class {notifier.stem}: {e}")
continue
if "notifier" in module.__dict__: