Class APIException

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
BadRequestError, EncodingError, ExternalApiError, ForbiddenError, GatewayTimeoutError, HttpError, InternalServerError, InvalidRequestError, JsonError, MethodNotAllowedError, NotFoundError, PaymentError, RateLimitError, RedirectError, ServiceUnavailableError, TimeoutError, UnauthorizedError, UnknownApiError

public class APIException extends EasyPostException
See Also:
  • Constructor Details

    • APIException

      public APIException(String message)
      APIException constructor.
      Parameters:
      message - the exception message
    • APIException

      public APIException(String message, Throwable ex)
      APIException constructor.
      Parameters:
      message - the exception message
      ex - the exception cause
    • APIException

      public APIException(String message, String code, List<Object> errors)
      APIException constructor.
      Parameters:
      message - the exception message
      code - the exception code
      errors - the errors array
    • APIException

      public APIException(String message, String code, List<Object> errors, Integer statusCode)
      APIException constructor.
      Parameters:
      message - the exception message
      code - the exception code
      errors - the errors array
      statusCode - the exception status code
    • APIException

      public APIException(String message, String code, List<Object> errors, Integer statusCode, Throwable ex)
      APIException constructor.
      Parameters:
      message - the exception message
      code - the exception code
      errors - the errors array
      statusCode - the exception status code
      ex - the exception cause
  • Method Details

    • getStatusCode

      public Integer getStatusCode()
      Get status code of the error object.
      Returns:
      statusCode the status code of the error object
    • getCode

      public String getCode()
      Get code of the error object.
      Returns:
      code the code of the error object
    • getMessage

      public String getMessage()
      Get message of the error object.
      Overrides:
      getMessage in class Throwable
      Returns:
      message the message of the error object
    • getErrors

      public List<Object> getErrors()
      Get errors array of the exception.
      Returns:
      errors of the exception