src/applications/h2/src/tools/org/h2/jaqu/util/Message.java
/**
     * Convert an exception to a SQL exception using the default mapping.
     *
     * @param e the root cause
     * @return the SQL exception object
     */
Convert an exception to a SQL exception using the default mapping.
@param e the root cause
@return the SQL exception object
Convert an exception to a SQL exception using the default mapping . @param e the root cause @return the SQL exception object
public static SQLException convert(Throwable e) {
        if (e instanceof SQLException) {
            return (SQLException) e;
        }
        String message;
        if (e instanceof InvocationTargetException) {
            InvocationTargetException te = (InvocationTargetException) e;
            Throwable t = te.getTargetException();
            if (t instanceof SQLException) {
                return (SQLException) t;
            }
            message = "Invocation exception";
        } else if (e instanceof IOException) {
            message = "IO exception";
        } else {
            message = "General exception";
        }
        return new SQLException(message + ": " + e.toString(), e);
    }
public static SQLException convert ( Throwable e ) { if ( e instanceof SQLException ) { return ( SQLException ) e ; } String message ; if ( e instanceof InvocationTargetException ) { InvocationTargetException te = ( InvocationTargetException ) e ; Throwable t = te . getTargetException ( ) ; if ( t instanceof SQLException ) { return ( SQLException ) t ; } message = "Invocation exception" ; } else if ( e instanceof IOException ) { message = "IO exception" ; } else { message = "General exception" ; } return new SQLException ( message + ": " + e . toString ( ) , e ) ; }
Convert an exception to a SQL exception using the default mapping.
Convert an exception to a SQL exception using the default mapping .