String (Exception exception) { String baseMessage = exception.getMessage(); Throwable rootCause = ExceptionUtils.getRootCause(exception); String rootMessage = rootCause != null ? rootCause.getMessage() : StringUtils.EMPTY; return StringUtils.isNotEmpty(rootMessage) ? rootMessage : baseMessage; }