Class ApiException

java.lang.Object
java.lang.Throwable
java.lang.Exception
com.symphony.bdk.http.api.ApiException
All Implemented Interfaces:
Serializable

@API(status=STABLE) public class ApiException extends Exception
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 Details

    • ApiException

      public ApiException(String message, Throwable throwable)
      Creates new ApiException instance.
      Parameters:
      message - the detail message.
      throwable - the cause.
    • ApiException

      public ApiException(int code, Throwable throwable)
      Creates new ApiException instance.
      Parameters:
      code - the HTTP response status code.
      throwable - the cause.
    • ApiException

      public ApiException(int code, String message)
      Creates new ApiException 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 new ApiException 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