/** * Return the message from the root cause of the exception. If the root * cause has no message, then return the passed exception's message. */ private String getRootCauseMessage(Exception e) { String msg = ExceptionUtil.getRootCause(e).getMessage(); if (msg != null && msg.length() > 0) { return msg; } else { return e.getMessage(); } }
/** Get the original troublemaker. @param e the Exception to dig into @return the original Throwable that started the problem */ public static Throwable getRootCause(final Throwable e) { final Throwable[] causes = getCauses(e); return (causes[causes.length - 1]); }
/** * Return the message from the root cause of the exception. If the root * cause has no message, then return the passed exception's message. */ private String getRootCauseMessage(Exception e) { String msg = ExceptionUtil.getRootCause(e).getMessage(); if (msg != null && msg.length() > 0) { return msg; } else { return e.getMessage(); } }
/** Get the original troublemaker. @param e the Exception to dig into @return the original Throwable that started the problem */ public static Throwable getRootCause(final Throwable e) { final Throwable[] causes = getCauses(e); return (causes[causes.length - 1]); }
/** * Takes an action report and updates the message in the report with * the message from the root cause of the report. * * @param report */ static void sanitizeReport(ActionReport report) { if (report != null && report.hasFailures() && report.getFailureCause() != null) { Throwable rootCause = ExceptionUtil.getRootCause( report.getFailureCause()); if (rootCause != null && StringUtils.ok(rootCause.getMessage())) { report.setMessage(rootCause.getMessage()); } } }
/** Get the original troublemaker. @param e the Exception to dig into @return the original Throwable that started the problem */ public static Throwable getRootCause(final Throwable e) { final Throwable[] causes = getCauses(e); return (causes[causes.length - 1]); }
/** * Takes an action report and updates the message in the report with * the message from the root cause of the report. * * @param report */ static void sanitizeReport(ActionReport report) { if (report != null && report.hasFailures() && report.getFailureCause() != null) { Throwable rootCause = ExceptionUtil.getRootCause( report.getFailureCause()); if (rootCause != null && StringUtils.ok(rootCause.getMessage())) { report.setMessage(rootCause.getMessage()); } } }
if (exmsg == null) { exmsg = ExceptionUtil.getRootCause(ex).toString();
if (exmsg == null) { exmsg = ExceptionUtil.getRootCause(ex).toString();