Additional error checking to fix #282

This commit is contained in:
bobokun 2023-05-06 09:37:11 -04:00
parent 8684066e40
commit 3a8bdf526f
No known key found for this signature in database
GPG key ID: B73932169607D927
2 changed files with 25 additions and 28 deletions

View file

@ -110,6 +110,7 @@ class Config:
self.data["notifiarr"] = self.data.pop("notifiarr")
if "webhooks" in self.data:
temp = self.data.pop("webhooks")
if temp is not None:
if "function" not in temp or ("function" in temp and temp["function"] is None):
temp["function"] = {}

View file

@ -377,16 +377,12 @@ def start():
try:
cfg = Config(default_dir, args)
qbit_manager = cfg.qbt
except Exception as ex:
if "Qbittorrent Error" in ex.args[0]:
logger.stacktrace()
logger.print_line(ex, "CRITICAL")
logger.print_line("Exiting scheduled Run.", "CRITICAL")
finished_run()
return None
else:
logger.stacktrace()
logger.print_line(ex, "CRITICAL")
if qbit_manager:
# Set Category