Class ApiException

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ConflictException, ForbiddenException, NotFoundException, RateLimitedException, ServerFaultException, UnauthorizedException, ValidationException

public class ApiException extends TripSwitchException
Represents an error response from the Tripswitch API. Use instanceof to check for specific error types.
See Also:
  • Constructor Details

    • ApiException

      public ApiException(int status, String code, String message, String requestId, byte[] body, Duration retryAfter)
  • Method Details

    • getStatus

      public int getStatus()
    • getCode

      public String getCode()
    • getRequestId

      public String getRequestId()
    • getBody

      public byte[] getBody()
    • getRetryAfter

      public Duration 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.