Package com.longbridge
Class OpenApiException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- com.longbridge.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, ornullfor client-side errorsgetMessage()– human-readable error description
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description OpenApiException(ErrorKind kind, Long code, String message)Constructs anOpenApiException.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LonggetCode()Returns the numeric error code returned by the server.ErrorKindgetKind()Returns the error kind.StringgetMessage()Returns the human-readable error description.StringtoString()-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
-
-
-
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
nullfor client-side errors
-
getMessage
public String getMessage()
Returns the human-readable error description.- Overrides:
getMessagein classThrowable- Returns:
- error message
-
-