question: public static LdapException newLdapException ( ResultCode resultCode , CharSequence diagnosticMessage , Throwable cause ) { final Result result = Responses . newResult ( resultCode ) ; if ( diagnosticMessage != null ) { result . setDiagnosticMessage ( diagnosticMessage . toString ( ) ) ; } else if ( cause != null ) { result . setDiagnosticMessage ( cause . getLocalizedMessage ( ) ) ; } result . setCause ( cause ) ; return newLdapException ( result ) ; }
target:  Creates a new LDAP exception with the provided result code, diagnostic message, and cause.