OP-2399 - moved error at the beginning of the log

This commit is contained in:
Petr Kalis 2022-01-19 11:57:27 +01:00
parent f28b4242c8
commit 3b6e030465

View file

@ -95,7 +95,8 @@ def publish_and_log(dbcon, _id, log, close_plugin_name=None):
close host app
"""
# Error exit as soon as any error occurs.
error_format = "Failed {plugin.__name__}: {error} -- {error.traceback}"
error_format = "Failed {plugin.__name__}: {error} -- {error.traceback}\n"
error_format += "-" * 80 + "\n"
close_plugin = _get_close_plugin(close_plugin_name, log)
@ -111,7 +112,7 @@ def publish_and_log(dbcon, _id, log, close_plugin_name=None):
if result["error"]:
log.error(error_format.format(**result))
uninstall()
log_lines.append(error_format.format(**result))
log_lines = [error_format.format(**result)] + log_lines
dbcon.update_one(
{"_id": _id},
{"$set":