@SuppressWarnings("unchecked") final List<Map<String, Object>> stackTrace = (List<Map<String, Object>>) thrown.get("stackTrace"); assertEquals("The thrown stack trace length is not correct.", exception2.getStackTrace().length, stackTrace.size()); for (int i = 0; i < exception2.getStackTrace().length; i++) { final StackTraceElement e1 = exception2.getStackTrace()[i]; final Map<String, Object> e2 = stackTrace.get(i);
@Override public StackTraceElement[] getStackTrace() { if (!this.hasSetStackTrace) { ArrayList<StackTraceElement> frames = new ArrayList<StackTraceElement>(this.exceptions.size() * 20); int exceptionNum = 0; for (SQLException exception : this.exceptions) { StackTraceElement header = new StackTraceElement(MultipleCausesSQLException.class.getName(), "Exception Number " + exceptionNum, "<no file>", 0); frames.add(header); for (StackTraceElement ste : exception.getStackTrace()) { frames.add(ste); } exceptionNum++; } setStackTrace(frames.toArray(new StackTraceElement[frames.size()])); this.hasSetStackTrace = true; } return super.getStackTrace(); }
@Override public StackTraceElement[] getStackTrace() { if (!this.hasSetStackTrace) { ArrayList<StackTraceElement> frames = new ArrayList<StackTraceElement>(this.exceptions.size() * 20); int exceptionNum = 0; for (SQLException exception : this.exceptions) { StackTraceElement header = new StackTraceElement(MultipleCausesSQLException.class.getName(), "Exception Number " + exceptionNum, "<no file>", 0); frames.add(header); for (StackTraceElement ste : exception.getStackTrace()) { frames.add(ste); } exceptionNum++; } setStackTrace(frames.toArray(new StackTraceElement[frames.size()])); this.hasSetStackTrace = true; } return super.getStackTrace(); }
public VerboseSQLException(SQLException exception, String verboseErrorMessage) { super(exception.getMessage(), exception.getSQLState(), exception.getErrorCode()); setNextException(exception.getNextException()); setStackTrace(exception.getStackTrace()); if (exception.getCause() != null) { initCause(exception.getCause()); } else if (exception.getNextException() != null) { initCause(exception.getNextException()); } this.verboseErrorMessage = verboseErrorMessage; }
public void handleError(SQLException ex) { log("Could not read the primary keys for table '" + tableName + "' from the result set: " + ex.getStackTrace(), Project.MSG_ERR); } });
public void handleError(SQLException ex) { log("Could not determine the foreign keys for table '" + tableName + "': " + ex.getStackTrace(), Project.MSG_ERR); } });
public void handleError(SQLException ex) { log("Could not read the columns for procedure '"+procedureName+"' from the result set: " + ex.getStackTrace(), Project.MSG_ERR); } });
public void handleError(SQLException ex) { log("Could not read the catalogs from the result set: " + ex.getStackTrace(), Project.MSG_ERR); } });
public void handleError(SQLException ex) { log("Could not read the table types from the result set: " + ex.getStackTrace(), Project.MSG_ERR); } });
public void handleError(SQLException ex) { log("Could not read the colums for table '" + tableName + "' from the result set: "+ex.getStackTrace(), Project.MSG_ERR); } });
public void handleError(SQLException ex) { log("Could not read the procedures from the result set: " + ex.getStackTrace(), Project.MSG_ERR); } });
public void handleError(SQLException ex) { log("Could not read the schemas from the result set: " + ex.getStackTrace(), Project.MSG_ERR); } });
public void handleError(SQLException ex) { log("Could not read the tables from the result set: " + ex.getStackTrace(), Project.MSG_ERR); } });
public void handleError(SQLException ex) { log("Could not read the versioned columns for table '" + tableName + "' from the result set: " + ex.getStackTrace(), Project.MSG_ERR); } });
public void handleError(SQLException ex) { log("Could not read the indexes for table '" + tableName + "' from the result set: " + ex.getStackTrace(), Project.MSG_ERR); } });
public StrippedSQLException(@NotNull final SQLException originalException, @Nullable final Throwable cause) { super(prepareMessage(originalException), originalException.getSQLState(), originalException.getErrorCode(), cause); originalClassName = originalException.getClass().getName(); setStackTrace(originalException.getStackTrace()); }
public ExtendedSQLException(SQLException sqlException, String sql) { super(sqlException.getMessage(), sqlException.getSQLState(), sqlException.getErrorCode(), sqlException); setNextException(sqlException.getNextException()); setStackTrace(sqlException.getStackTrace()); this.sql = sql; }
private void printErrors(SQLException ex) { StackTraceElement element = ex.getStackTrace()[0]; mcMMO.p.getLogger().severe("Location: " + element.getClassName() + " " + element.getMethodName() + " " + element.getLineNumber()); mcMMO.p.getLogger().severe("SQLException: " + ex.getMessage()); mcMMO.p.getLogger().severe("SQLState: " + ex.getSQLState()); mcMMO.p.getLogger().severe("VendorError: " + ex.getErrorCode()); }
public JormSqlException(String database, String sql, SQLException sqlException) { super( rewriteMessage(sqlException.getMessage(), database, sql), sqlException.getSQLState(), sqlException.getErrorCode(), sqlException.getCause() ); this.database = database; this.sql = sql; setStackTrace(sqlException.getStackTrace()); }
public VerboseSQLException(SQLException exception, String verboseErrorMessage) { super(exception.getMessage(), exception.getSQLState(), exception.getErrorCode()); setNextException(exception.getNextException()); setStackTrace(exception.getStackTrace()); if (exception.getCause() != null) { initCause(exception.getCause()); } else if (exception.getNextException() != null) { initCause(exception.getNextException()); } this.verboseErrorMessage = verboseErrorMessage; }