Merge pull request #2559 from pypeclub/feature/OP-2399_Webpublisher-Better-error-messages-for-users

Webpublisher: Moved error at the beginning of the log
This commit is contained in:
Petr Kalis 2022-01-20 16:19:03 +01:00 committed by GitHub
commit d9143b9b25
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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)
@ -114,7 +115,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":