Class DSAPIException

All Implemented Interfaces:
SWIG_DSAPIConstants, Serializable
Direct Known Subclasses:
BadAddressException, BadAttributeTypeException, BadDNException, BadEntryException, BadFilterException, BadSyntaxException, BadValueException, ConfigOpFailedException, DeleteAttributeException, DirectoryOperationFailedException, EncryptionException, IncorrectVersionException, IndicationException, NoMorePagedResultsException, NoSuchAttributeException, NoSuchOperationException, NotBoundException, NotImplementedException, OperationFailedException, ReadFailedException, SignedOpFailedException

public class DSAPIException extends Exception implements SWIG_DSAPIConstants
Base class representing exception conditions that can be thrown by Java DSAPI classes.
See Also:
  • Constructor Details

    • DSAPIException

      public DSAPIException(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(String message)
      Constructs a new DSAPIException with the specified message.
      Parameters:
      message - gives extra detail about the specific exception.
    • DSAPIException

      public DSAPIException(String message, 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 Details

    • 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 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

      public static 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.