Class GaosBaseException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.google.genai.errors.ApiException
com.google.genai.gaos.models.errors.GaosBaseException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
GaosApiException
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionGaosBaseException(String message, int code, byte[] body, HttpResponse<?> rawResponse, Throwable cause) -
Method Summary
Modifier and TypeMethodDescriptionOptional<byte[]>body()intcode()Returns the status code from the API response.headers()Returns the headers from the raw HTTP response as a map.message()Returns the error message from the API response.HttpResponse<?>Returns the raw HTTP response associated with this exception.toString()withBody(byte[] body) withCode(int code) withRawResponse(HttpResponse<?> rawResponse) Methods inherited from class com.google.genai.errors.ApiException
status, throwFromErrorNode, throwFromResponseMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
Constructor Details
-
GaosBaseException
public GaosBaseException(String message, int code, @Nullable byte[] body, HttpResponse<?> rawResponse, @Nullable Throwable cause)
-
-
Method Details
-
body
-
bodyAsString
-
code
public int code()Description copied from class:ApiExceptionReturns the status code from the API response.- Overrides:
codein classApiException
-
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 thebody()method).- Returns:
- the raw HTTP response
-
headers
Returns the headers from the raw HTTP response as a map.- Returns:
- response headers
-
message
Description copied from class:ApiExceptionReturns the error message from the API response.- Overrides:
messagein classApiException
-
withCode
-
withBody
-
withRawResponse
-
toString
-