Package com.easypost.exception
Class APIException
java.lang.Object
java.lang.Throwable
java.lang.Exception
com.easypost.exception.EasyPostException
com.easypost.exception.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
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionAPIException
(String message) APIException constructor.APIException
(String message, String code, List<Object> errors) APIException constructor.APIException constructor.APIException constructor.APIException
(String message, Throwable ex) APIException constructor. -
Method Summary
Modifier and TypeMethodDescriptiongetCode()
Get code of the error object.Get errors array of the exception.Get message of the error object.Get status code of the error object.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
APIException
APIException constructor.- Parameters:
message
- the exception message
-
APIException
APIException constructor.- Parameters:
message
- the exception messageex
- the exception cause
-
APIException
APIException constructor.- Parameters:
message
- the exception messagecode
- the exception codeerrors
- the errors array
-
APIException
APIException constructor.- Parameters:
message
- the exception messagecode
- the exception codeerrors
- the errors arraystatusCode
- the exception status code
-
APIException
public APIException(String message, String code, List<Object> errors, Integer statusCode, Throwable ex) APIException constructor.- Parameters:
message
- the exception messagecode
- the exception codeerrors
- the errors arraystatusCode
- the exception status codeex
- the exception cause
-
-
Method Details
-
getStatusCode
Get status code of the error object.- Returns:
- statusCode the status code of the error object
-
getCode
Get code of the error object.- Returns:
- code the code of the error object
-
getMessage
Get message of the error object.- Overrides:
getMessage
in classThrowable
- Returns:
- message the message of the error object
-
getErrors
Get errors array of the exception.- Returns:
- errors of the exception
-