Java SQLException exceptionMsg2str(final Throwable e)

Here you can find the source of exceptionMsg2str(final Throwable e)

Description

exception Msgstr

License

Apache License

Declaration

public static final String exceptionMsg2str(final Throwable e) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.sql.SQLException;

public class Main {

    public static final String exceptionMsg2str(final Throwable e) {
        if (e == null)
            return null;
        String message = e.getMessage();
        if (message == null)
            message = e.getClass().getName();

        if (e instanceof SQLException) {
            SQLException nextException = ((SQLException) e).getNextException();
            if (nextException != null)
                message += "\r\n" + exceptionMsg2str(nextException);
        }//from ww  w  . j a  v  a  2s .  c  om
        return message;
    }
}

Related

  1. appendToExceptionList(List list, SQLException sqlException)
  2. convertSQLExceptionToString(SQLException e)
  3. createFeatureNotSupportedException()
  4. exceptionMsg2LocalizedStr(final Throwable e)
  5. exceptionToString(Throwable e)
  6. extractErrorCode(SQLException sqlException)
  7. extractNestedSQLExceptions( SQLException exception)
  8. extractSqlStateClassCode(SQLException sqlException)