From 238f5d9b8b9e4819a9909a7403dcbc7bec0dc714 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 29 Apr 2019 22:31:55 -0700 Subject: Log exception root cause --- src/main/java/org/traccar/helper/Log.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/main/java/org/traccar/helper') diff --git a/src/main/java/org/traccar/helper/Log.java b/src/main/java/org/traccar/helper/Log.java index f328e8ce9..607a0585f 100644 --- a/src/main/java/org/traccar/helper/Log.java +++ b/src/main/java/org/traccar/helper/Log.java @@ -211,6 +211,11 @@ public final class Log { } public static String exceptionStack(Throwable exception) { + Throwable cause; + while (null != (cause = exception.getCause()) && (exception != cause) ) { + exception = cause; + } + StringBuilder s = new StringBuilder(); String exceptionMsg = exception.getMessage(); if (exceptionMsg != null) { -- cgit v1.2.3