Search in sources :

Example 1 with DfProcedureListGettingFailureException

use of org.dbflute.exception.DfProcedureListGettingFailureException in project dbflute-core by dbflute.

the class DfProcedureExtractor method throwProcedureListGettingFailureException.

protected void throwProcedureListGettingFailureException(UnifiedSchema unifiedSchema, String procedureName, Exception e) throws SQLException {
    final boolean forSqlEx = e instanceof SQLException;
    final ExceptionMessageBuilder br = new ExceptionMessageBuilder();
    br.addNotice("Failed to get a list of procedures.");
    br.addItem("Unified Schema");
    br.addElement(unifiedSchema);
    br.addItem("Current Procedure");
    br.addElement(procedureName);
    br.addItem(forSqlEx ? "Caused SQLException" : "Unexpected Exception");
    br.addElement(e.getClass().getName());
    br.addElement(e.getMessage());
    final String msg = br.buildExceptionMessage();
    if (forSqlEx) {
        throw new DfJDBCException(msg, (SQLException) e);
    } else {
        throw new DfProcedureListGettingFailureException(msg, e);
    }
}
Also used : DfJDBCException(org.dbflute.exception.DfJDBCException) SQLException(java.sql.SQLException) ExceptionMessageBuilder(org.dbflute.helper.message.ExceptionMessageBuilder) DfProcedureListGettingFailureException(org.dbflute.exception.DfProcedureListGettingFailureException)

Aggregations

SQLException (java.sql.SQLException)1 DfJDBCException (org.dbflute.exception.DfJDBCException)1 DfProcedureListGettingFailureException (org.dbflute.exception.DfProcedureListGettingFailureException)1 ExceptionMessageBuilder (org.dbflute.helper.message.ExceptionMessageBuilder)1