Package com.symphony.bdk.http.api
Class ApiException
java.lang.Object
java.lang.Throwable
java.lang.Exception
com.symphony.bdk.http.api.ApiException
- All Implemented Interfaces:
Serializable
Main exception raised when invoking
ApiClient.invokeAPI(String, String, List, Object, Map, Map, Map, String, String, String[], TypeReference)
.
Initially generated by the OpenAPI Maven Generator
- See Also:
-
Constructor Summary
ConstructorDescriptionApiException
(int code, String message) Creates newApiException
instance.ApiException
(int code, String message, Map<String, List<String>> responseHeaders, String responseBody) Creates newApiException
instance.ApiException
(int code, Throwable throwable) Creates newApiException
instance.ApiException
(String message, Throwable throwable) Creates newApiException
instance. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Check if response status is client error or notboolean
Check if response status is a server error (5xx) but not an internal server error (500)boolean
Check if response status corresponds to a too many requests error (429)boolean
Check if response status is unauthorized or not.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
ApiException
Creates newApiException
instance.- Parameters:
message
- the detail message.throwable
- the cause.
-
ApiException
Creates newApiException
instance.- Parameters:
code
- the HTTP response status code.throwable
- the cause.
-
ApiException
Creates newApiException
instance.- Parameters:
code
- the HTTP response status code.message
- the detail message.
-
ApiException
public ApiException(int code, String message, Map<String, List<String>> responseHeaders, String responseBody) Creates newApiException
instance.- Parameters:
code
- the HTTP response status code.message
- the detail message.responseHeaders
- list of headers returned by the server.responseBody
- content of the response sent back by the server.
-
-
Method Details
-
isUnauthorized
public boolean isUnauthorized()Check if response status is unauthorized or not.- Returns:
- true if response status is 401, false otherwise
-
isClientError
public boolean isClientError()Check if response status is client error or not- Returns:
- true if response status is 400, false otherwise
-
isServerError
public boolean isServerError()Check if response status is a server error (5xx) but not an internal server error (500)- Returns:
- true if response status strictly greater than 500, false otherwise
-
isTooManyRequestsError
public boolean isTooManyRequestsError()Check if response status corresponds to a too many requests error (429)- Returns:
- true if error code is 429
-