/** * @see net.sourceforge.squirrel_sql.client.session.ISession#formatException(java.lang.Throwable) */ public String formatException(Throwable th) { return this.formatter.format(th); }
/** * @see net.sourceforge.squirrel_sql.client.session.ISession#setExceptionFormatter(net.sourceforge.squirrel_sql.fw.util.ExceptionFormatter) */ public void setExceptionFormatter(ExceptionFormatter formatter) { this.formatter.setCustomExceptionFormatter(formatter); }
@Override public boolean formatsException(Throwable t) { return defaultFormatter.formatsException(t); }
/** * @see net.sourceforge.squirrel_sql.client.session.ISession#formatException(java.lang.Throwable) */ public String formatException(Throwable th) { return this.formatter.format(th); }
/** * @see net.sourceforge.squirrel_sql.client.session.ISession#setExceptionFormatter(net.sourceforge.squirrel_sql.fw.util.ExceptionFormatter) */ public void setExceptionFormatter(ExceptionFormatter formatter) { this.formatter.setCustomExceptionFormatter(formatter); }
@Override public String format(Throwable t) throws Exception { /* * Only reformat SQLWarning: */ if (t instanceof SQLWarning) { final SQLWarning warning = (SQLWarning) t; return defaultFormatWarningMessage(warning); } return defaultFormatter.format(t); }
msg.append(defaultFormatter.format(t)); ISQLConnection sqlcon = _session.getSQLConnection(); if (sqlcon != null && sqlcon.getConnection() != null)
/** * Private method, the real implementation of the corresponding show*Message methods. * * @param th The throwable whose details shall be displayed. * @param saSet The SimpleAttributeSet to be used for message output. */ private void privateShowMessage(final Throwable th, final ExceptionFormatter formatter, final SimpleAttributeSet saSet) { if (th != null) { String message = ""; if (formatter == null) { message = defaultExceptionFormatter.format(th); } else { try { message = formatter.format(th); } catch (Exception e) { s_log.error("Unable to format message: "+e.getMessage(), e); } } privateShowMessage(message, saSet); s_log.error("privateShowMessage: Exception was "+th.getMessage(), th); } }
/** * Private method, the real implementation of the corresponding show*Message methods. * * @param th The throwable whose details shall be displayed. * @param saSet The SimpleAttributeSet to be used for message output. */ private void privateShowMessage(final Throwable th, final ExceptionFormatter formatter, final SimpleAttributeSet saSet) { if (th != null) { String message = ""; if (formatter == null) { message = defaultExceptionFormatter.format(th); } else { try { message = formatter.format(th); } catch (Exception e) { s_log.error("Unable to format message: "+e.getMessage(), e); } } privateShowMessage(message, saSet); s_log.error("privateShowMessage: Exception was "+th.getMessage(), th); } }