lint: excuse catching broad exceptions
This commit is contained in:
parent
9797d8d119
commit
fce594bbc4
2 changed files with 9 additions and 3 deletions
|
@ -85,14 +85,18 @@ def run_job(job_cls: Type[BaseAutomation], *,
|
|||
logging.warning("Not time to run this job yet")
|
||||
return
|
||||
if not automation.enabled and not force:
|
||||
logging.warning(f"job {job_cls.short_name} is disabled and --force not specified")
|
||||
logging.warning("job %s is disabled and --force not specified", job_cls.short_name)
|
||||
return
|
||||
automation.state = AutomationState.RUNNING
|
||||
db.session.commit()
|
||||
job: BaseAutomation = job_cls()
|
||||
try:
|
||||
success, logs = job.automate()
|
||||
except Exception as e:
|
||||
# We want to catch any and all exceptions that would cause problems here, because
|
||||
# the error handling process isn't really handling the error, but rather causing it
|
||||
# to be logged for investigation. Catching more specific exceptions would just mean that
|
||||
# others go unrecorded and are difficult to debug.
|
||||
except Exception as e: # pylint: disable=broad-except
|
||||
tb = TracebackException.from_exception(e)
|
||||
success = False
|
||||
logs = "".join(tb.format())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue