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:
parent
e53a723188
commit
62227ec644
1 changed files with 2 additions and 2 deletions
|
@ -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__:
|
||||
|
|
Loading…
Reference in a new issue