Class DSAPIException

    • Constructor Detail

      • DSAPIException

        public DSAPIException​(java.lang.String message,
                              int nativeErrorCode)
        Constructs a new DSAPIException with the specified message and error code
        Parameters:
        message - gives extra detail about the specific exception.
        nativeErrorCode - a value as returned from underlying native code which may be useful in determining the cause of the problem.
      • DSAPIException

        public DSAPIException​(java.lang.String message)
        Constructs a new DSAPIException with the specified message.
        Parameters:
        message - gives extra detail about the specific exception.
      • DSAPIException

        public DSAPIException​(java.lang.String message,
                              java.lang.Throwable cause)
        Constructs a new DSAPIException with the specified message and cause.
        Parameters:
        message - gives extra detail about the specific exception.
        cause - the cause (which is saved for later retrieval by the Throwable.getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
        Since:
        15.0
    • Method Detail

      • getNativeErrorCode

        public int getNativeErrorCode()
        Determine the native error code (if any) associated with this exception.
        Returns:
        the native error code, which will be zero if no code is associated with this exception.
      • getNativeErrorString

        public java.lang.String getNativeErrorString()
        Return the name of a native error code in String format, for example "DS_E_BADDN".
        Returns:
        a String containing the symbolic name of the error code.
        See Also:
        nativeErrorToString(int)
      • nativeErrorToString

        public static java.lang.String nativeErrorToString​(int ds_status_code)
        Translate native DS_Status error code value into a String, for example "DS_E_BADDN".

        The native layer will typically not throw "DSAPIException" objects, but an exception appropriate to the error type, e.g. BadDNException. Therefore, the Strings returned by this method are primarily of interest for debugging purposes, rather than intended for displaying to a user of an application.

        Parameters:
        ds_status_code - a DSAPI error code, which should be one of the DS_Status constants
        Returns:
        a String containing the symbolic name of the error code. In the case of an unknown error, a String of the form "unknown DS_Status (x)" will be returned.