private static final String formatMessage(String resourceKey, Throwable exception, Object... formatArguments) {
        String message = Tr.formatMessage(tc, resourceKey, formatArguments);
        if (exception instanceof SQLException) {
            SQLException sqlX = (SQLException) exception;
            StringBuilder st = new StringBuilder(message.length() + 40);
            st.append(message).append(" with SQL State : ").append(sqlX.getSQLState()).append(" SQL Code : ").append(sqlX.getErrorCode());
            message = st.toString();   
        }
        return message;
    }
private static final String formatMessage ( String resourceKey , Throwable exception , Object ... formatArguments ) { String message = Tr . formatMessage ( tc , resourceKey , formatArguments ) ; if ( exception instanceof SQLException ) { SQLException sqlX = ( SQLException ) exception ; StringBuilder st = new StringBuilder ( message . length ( ) + 40 ) ; st . append ( message ) . append ( " with SQL State : " ) . append ( sqlX . getSQLState ( ) ) . append ( " SQL Code : " ) . append ( sqlX . getErrorCode ( ) ) ; message = st . toString ( ) ; } return message ; }
Utility method that preserves existing behavior of appending SQL State/error code to a translated message.