Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

Commit

Permalink
When tool logs the exception, don't use .message attribute (#70)
Browse files Browse the repository at this point in the history
Some exceptions don't have it, rely on exceptions' str()
  • Loading branch information
happz committed Jun 13, 2019
1 parent d00d3db commit bda0ec2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions gluetool/tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,13 @@ def _handle_failure_core(self, failure):
exit_status = 0 if failure.soft is True else -1

if failure.module:
msg = "Pipeline reported an exception in module '{}': {}".format(failure.module.unique_name, failure.exc_info[1].message)
msg = "Pipeline reported an exception in module '{}': {}".format(
failure.module.unique_name,
failure.exc_info[1]
)

else:
msg = "Pipeline reported an exception: {}".format(failure.exc_info[1].message)
msg = "Pipeline reported an exception: {}".format(failure.exc_info[1])

logger.error(msg, exc_info=failure.exc_info)

Expand Down

0 comments on commit bda0ec2

Please sign in to comment.