Class GaosBaseException

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
GaosApiException

public abstract class GaosBaseException extends ApiException
See Also:
  • Constructor Details

    • GaosBaseException

      public GaosBaseException(String message, int code, @Nullable byte[] body, HttpResponse<?> rawResponse, @Nullable Throwable cause)
  • Method Details

    • body

      public Optional<byte[]> body()
    • bodyAsString

      public Optional<String> bodyAsString()
    • code

      public int code()
      Description copied from class: ApiException
      Returns the status code from the API response.
      Overrides:
      code in class ApiException
    • rawResponse

      public HttpResponse<?> rawResponse()
      Returns the raw HTTP response associated with this exception. The response body stream may not be available (but the body can be accessed via the body() method).
      Returns:
      the raw HTTP response
    • headers

      public Headers headers()
      Returns the headers from the raw HTTP response as a map.
      Returns:
      response headers
    • message

      public String message()
      Description copied from class: ApiException
      Returns the error message from the API response.
      Overrides:
      message in class ApiException
    • withCode

      public GaosBaseException withCode(int code)
    • withBody

      public GaosBaseException withBody(@Nullable byte[] body)
    • withRawResponse

      public GaosBaseException withRawResponse(HttpResponse<?> rawResponse)
    • toString

      public String toString()
      Overrides:
      toString in class Throwable