Throwable e = exception;
exceptionStackItems = new ArrayDeque<ExceptionStackItem>();
do
{
exceptionStackItems.addFirst(new ExceptionStackItem(e));
if (e instanceof SQLException)
{
SQLException sqlException = (SQLException) e;
while (sqlException.getNextException() != null)
{
sqlException = sqlException.getNextException();
exceptionStackItems.addFirst(new ExceptionStackItem(sqlException));
}
}
e = e.getCause();
}
while (e != null);