mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-06-27 10:43:27 +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:
@ -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)
|
||||
|
Reference in New Issue
Block a user