1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2024-10-06 02:41:11 +01:00

utils/log: Convert exception to string before passing to Logger

Now that we add an event when logging errors, we need to avoid passing an
exception object directly to the logger. Otherwise we end up adding the
unserializable Exception object to the events list, which causes an error when
trying to write the output.
This commit is contained in:
Brendan Jackman 2017-10-23 17:25:15 +01:00
parent b11bd6cf12
commit 4b7d43de9e

View File

@ -171,7 +171,7 @@ def log_error(e, logger, critical=False):
if isinstance(e, KeyboardInterrupt):
log_func('Got CTRL-C. Aborting.')
elif isinstance(e, WAError) or isinstance(e, DevlibError):
log_func(e)
log_func(str(e))
elif isinstance(e, subprocess.CalledProcessError):
tb = get_traceback()
log_func(tb)