Improve message when rule action fails (#3593)

Also logs the full stacktrace at DEBUG level

Signed-off-by: Jan N. Klug <github@klug.nrw>
pull/3595/head
J-N-K 2023-05-05 20:16:55 +02:00 committed by GitHub
parent 9c59071038
commit d7ba8ad636
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -1183,8 +1183,9 @@ public class RuleEngineImpl implements RuleManager, RegistryChangeListener<Modul
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);