Class OpenApiException

  • All Implemented Interfaces:
    Serializable

    public class OpenApiException
    extends Exception
    Exception thrown by the Longbridge OpenAPI SDK.

    Every SDK operation that can fail will throw this exception. It carries three pieces of diagnostic information:

    • getKind() – broad category of the error (HTTP, OpenAPI, OAuth, Other)
    • getCode() – numeric error code returned by the server, or null for client-side errors
    • getMessage() – human-readable error description
    See Also:
    Serialized Form
    • Constructor Detail

      • OpenApiException

        public OpenApiException​(ErrorKind kind,
                                Long code,
                                String message)
        Constructs an OpenApiException.
        Parameters:
        kind - error kind
        code - numeric error code (may be null)
        message - human-readable error description
    • Method Detail

      • getKind

        public ErrorKind getKind()
        Returns the error kind.
        Returns:
        error kind
      • getCode

        public Long getCode()
        Returns the numeric error code returned by the server.
        Returns:
        error code, or null for client-side errors
      • getMessage

        public String getMessage()
        Returns the human-readable error description.
        Overrides:
        getMessage in class Throwable
        Returns:
        error message