Skip to content

Commit 9718a0b

Browse files
committed
Add the exception message to the log output if present
Signed-off-by: Ole Petter <ole.orhagen@northern.tech>
1 parent 3d53ec9 commit 9718a0b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

libraries/python/cfengine.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,9 @@ def _handle_evaluate(self, promiser, attributes, request):
384384
except Exception as e:
385385
self.log_critical(
386386
"{error_type}: {error}".format(error_type=type(e).__name__, error=e)
387+
+ e.message
388+
if hasattr(e, "message")
389+
else ""
387390
)
388391
self._add_traceback_to_response()
389392
self._result = Result.ERROR

0 commit comments

Comments
 (0)