From 62227ec6442dca1c7d0655e5a030e8ec218e1244 Mon Sep 17 00:00:00 2001 From: Kumi Date: Wed, 6 Sep 2023 13:38:35 +0200 Subject: [PATCH] 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. --- src/trackbert/classes/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/trackbert/classes/core.py b/src/trackbert/classes/core.py index df0923c..0af16be 100644 --- a/src/trackbert/classes/core.py +++ b/src/trackbert/classes/core.py @@ -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__: