Package dev.tripswitch.admin
Class ApiException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
dev.tripswitch.TripSwitchException
dev.tripswitch.admin.ApiException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ConflictException,ForbiddenException,NotFoundException,RateLimitedException,ServerFaultException,UnauthorizedException,ValidationException
Represents an error response from the Tripswitch API.
Use
instanceof to check for specific error types.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionApiException(int status, String code, String message, String requestId, byte[] body, Duration retryAfter) -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
ApiException
-
-
Method Details
-
getStatus
public int getStatus() -
getCode
-
getRequestId
-
getBody
public byte[] getBody() -
getRetryAfter
-
forStatus
public static ApiException forStatus(int status, String code, String message, String requestId, byte[] body, String retryAfterHeader) Maps an HTTP status code to the appropriate exception subclass.
-