From 063ad28adc04852c7c130f0a146b28f721cce7b9 Mon Sep 17 00:00:00 2001 From: querdenker2k Date: Sun, 2 Jul 2023 07:17:07 +0200 Subject: [PATCH] print useful exception trace while InvocationTargetException --- .../openhab/automation/jrule/internal/engine/JRuleEngine.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/openhab/automation/jrule/internal/engine/JRuleEngine.java b/src/main/java/org/openhab/automation/jrule/internal/engine/JRuleEngine.java index b81ba985..0696e74e 100644 --- a/src/main/java/org/openhab/automation/jrule/internal/engine/JRuleEngine.java +++ b/src/main/java/org/openhab/automation/jrule/internal/engine/JRuleEngine.java @@ -535,7 +535,7 @@ private void invokeRuleInternal(JRuleExecutionContext context, JRuleEvent event) ExceptionUtils.getStackTrace(e)); } catch (InvocationTargetException e) { JRuleLog.error(logger, context.getMethod().getName(), "Error in rule: {}", - ExceptionUtils.getStackTrace(e.getCause())); + ExceptionUtils.getStackTrace(e.getTargetException())); } finally { Arrays.stream(context.getLoggingTags()).forEach(MDC::remove); MDC.remove(MDC_KEY_RULE);