/** * @return A short printable form of the stack trace of an exception. * @param t */ public static String getShortPrintableStackTrace(final Throwable t) { StringBuffer sb = new StringBuffer(); List<String> strings = getShortStackTraceStrings(t); String separator = ""; for (String string : strings) { sb.append(separator).append(string); separator = "\n"; } return sb.toString(); }
/** * @return the stack trace of the exception that was thrown. */ public List<String> getExceptionShortStackTrace() { Throwable t = getThrowable(); if (t == null) { return null; } return ExceptionUtils.getShortStackTraceStrings(t); }
/** * @return a StringBuffer. */ private StringBuffer getHtmlReportException() { StringBuffer sb = new StringBuffer(); sb.append(header(getString("EXCEPTION.HEADER.EXCEPTION"))); String name = ""; String message = ""; String stackTrace = ""; String shortStackTrace = ""; Throwable t = getThrowable(); if (t != null) { Throwable cause = ExceptionUtils.getRealCause(t); name = StringUtilsWeb.escapeHtml(cause.getClass().getSimpleName()); message = StringUtilsWeb.escapeHtml(cause.getMessage()); shortStackTrace = html(ExceptionUtils.getShortStackTraceStrings(t)); stackTrace = html(ExceptionUtils.getStackTraceStrings(t)); } sb.append(row2(getString("EXCEPTION.EXCEPTION.NAME"), name)); sb.append(row2(getString("EXCEPTION.EXCEPTION.MESSAGE"), message)); sb.append(row2(getString("EXCEPTION.EXCEPTION.SHORT_STACK_TRACE"), shortStackTrace)); sb.append(row2(getString("EXCEPTION.EXCEPTION.STACK_TRACE"), stackTrace)); return sb; }