Class X400APIException

java.lang.Object
java.lang.Throwable
java.lang.Exception
com.isode.x400.highlevel.X400APIException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
BadDNException, FileException, NotBoundException

public class X400APIException extends Exception
Base class representing exception conditions that can be thrown by the Java X.400 API classes.
See Also:
  • Constructor Details

    • X400APIException

      public X400APIException(String message, int nativeErrorCode)
      Constructs a new X400APIException 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.
    • X400APIException

      public X400APIException(String message)
      Constructs a new X400APIException with the specified message.
      Parameters:
      message - gives extra detail about the specific exception.
  • 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 for 11 (X400_E_BADCREDENTIALS), it returns "Invalid credentials for connection"
      Returns:
      a String with an explanation of the error code
    • nativeErrorToString

      public static String nativeErrorToString(int ds_status_code)
      Deprecated.
      callers should use #nativeErrorToString(),
      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.
    • getLocalizedMessage

      public String getLocalizedMessage()
      Override the existing getLocalizedMessage by appending the native error in brackets, if available
      Overrides:
      getLocalizedMessage in class Throwable