Skip to content

Commit

Permalink
Improve message when rule action fails (#3593)
Browse files Browse the repository at this point in the history
Also logs the full stacktrace at DEBUG level

Signed-off-by: Jan N. Klug <github@klug.nrw>
  • Loading branch information
J-N-K authored May 5, 2023
1 parent 9c59071 commit d7ba8ad
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1183,8 +1183,9 @@ private void executeActions(WrappedRule rule, boolean stopOnFirstFail) {
updateContext(ruleUID, action.getId(), outputs);
}
} catch (Throwable t) {
String errMessage = "Fail to execute action: " + action.getId();
String errMessage = "Failed to execute action: " + action.getId() + "(" + t.getMessage() + ")";
if (stopOnFirstFail) {
logger.debug("Action {}-{} threw an exception: ", ruleUID, action.getId(), t);
throw new RuntimeException(errMessage, t);
} else {
logger.warn(errMessage, t);
Expand Down

0 comments on commit d7ba8ad

Please sign in to comment.