Commit 87914be4af396613b85966647974d9583a23b1e4
1 parent
b22404e9
Improved logging of Rule Node Errors
Showing
1 changed file
with
11 additions
and
1 deletions
@@ -244,8 +244,18 @@ class DefaultTbContext implements TbContext { | @@ -244,8 +244,18 @@ class DefaultTbContext implements TbContext { | ||
244 | if (nodeCtx.getSelf().isDebugMode()) { | 244 | if (nodeCtx.getSelf().isDebugMode()) { |
245 | mainCtx.persistDebugOutput(nodeCtx.getTenantId(), nodeCtx.getSelf().getId(), msg, TbRelationTypes.FAILURE, th); | 245 | mainCtx.persistDebugOutput(nodeCtx.getTenantId(), nodeCtx.getSelf().getId(), msg, TbRelationTypes.FAILURE, th); |
246 | } | 246 | } |
247 | + String failureMessage; | ||
248 | + if (th != null) { | ||
249 | + if (!StringUtils.isEmpty(th.getMessage())) { | ||
250 | + failureMessage = th.getMessage(); | ||
251 | + } else { | ||
252 | + failureMessage = th.getClass().getSimpleName(); | ||
253 | + } | ||
254 | + } else { | ||
255 | + failureMessage = null; | ||
256 | + } | ||
247 | nodeCtx.getChainActor().tell(new RuleNodeToRuleChainTellNextMsg(nodeCtx.getSelf().getId(), Collections.singleton(TbRelationTypes.FAILURE), | 257 | nodeCtx.getChainActor().tell(new RuleNodeToRuleChainTellNextMsg(nodeCtx.getSelf().getId(), Collections.singleton(TbRelationTypes.FAILURE), |
248 | - msg, th != null ? th.getMessage() : null)); | 258 | + msg, failureMessage)); |
249 | } | 259 | } |
250 | 260 | ||
251 | public void updateSelf(RuleNode self) { | 261 | public void updateSelf(RuleNode self) { |