private void clientLogError(String message, Throwable e) { // Only print to client if there is one; // do not print TransformerException and SAXParseException // (that has been done by the LoggingErrorHander already). if (!(clientLogger == null || e instanceof TransformerException || e instanceof SAXParseException)) clientLogger.error(message + "\n" + MaryUtils.getThrowableAndCausesAsString(e)); // No stack trace on clientLogger }
private void clientLogError(String message, Throwable e) { // Only print to client if there is one; // do not print TransformerException and SAXParseException // (that has been done by the LoggingErrorHander already). if (!(clientLogger == null || e instanceof TransformerException || e instanceof SAXParseException)) clientLogger.error(message + "\n" + MaryUtils.getThrowableAndCausesAsString(e)); // No stack trace on clientLogger }
/** * Apply the toString() method recursively to this throwable and all its causes. The idea is to get cause information as in * printStackTrace() without the stack trace. * * @param t * the throwable to print. * @return buf converted to string */ public static String getThrowableAndCausesAsString(Throwable t) { StringBuffer buf = new StringBuffer(); buf.append(t.toString()); if (t.getCause() != null) { buf.append("\nCaused by: "); buf.append(getThrowableAndCausesAsString(t.getCause())); } return buf.toString(); }
/** * Apply the toString() method recursively to this throwable and all its causes. The idea is to get cause information as in * printStackTrace() without the stack trace. * * @param t * the throwable to print. * @return buf converted to string */ public static String getThrowableAndCausesAsString(Throwable t) { StringBuffer buf = new StringBuffer(); buf.append(t.toString()); if (t.getCause() != null) { buf.append("\nCaused by: "); buf.append(getThrowableAndCausesAsString(t.getCause())); } return buf.toString(); }
private void clientLogError(String message, Throwable e) { // Only print to client if there is one; // do not print TransformerException and SAXParseException // (that has been done by the LoggingErrorHander already). if (!(clientLogger == null || e instanceof TransformerException || e instanceof SAXParseException)) clientLogger.error(message + "\n" + MaryUtils.getThrowableAndCausesAsString(e)); // No stack trace on clientLogger }