Class StackOneError
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- com.stackone.stackone_client_java.models.errors.StackOneError
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
AsyncSDKError,AuthException,BadGatewayResponse,BadRequestResponse,ConflictResponse,ForbiddenResponse,InternalServerErrorResponse,NotFoundResponse,NotImplementedResponse,PreconditionFailedResponse,RequestTimedOutResponse,SDKError,TooManyRequestsResponse,UnauthorizedResponse,UnprocessableEntityResponse
public abstract class StackOneError extends java.lang.RuntimeException- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description StackOneError(java.lang.String message, int code, byte[] body, java.net.http.HttpResponse<?> rawResponse, java.lang.Throwable cause)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<byte[]>body()java.util.Optional<java.lang.String>bodyAsString()intcode()Headersheaders()Returns the headers from the raw HTTP response as a map.java.lang.Stringmessage()java.net.http.HttpResponse<?>rawResponse()Returns the raw HTTP response associated with this exception.java.lang.StringtoString()StackOneErrorwithBody(byte[] body)StackOneErrorwithCode(int code)StackOneErrorwithRawResponse(java.net.http.HttpResponse<?> rawResponse)
-
-
-
Method Detail
-
body
public java.util.Optional<byte[]> body()
-
bodyAsString
public java.util.Optional<java.lang.String> bodyAsString()
-
code
public int code()
-
rawResponse
public java.net.http.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 thebody()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 java.lang.String message()
-
withCode
public StackOneError withCode(int code)
-
withBody
public StackOneError withBody(@Nullable byte[] body)
-
withRawResponse
public StackOneError withRawResponse(java.net.http.HttpResponse<?> rawResponse)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Throwable
-
-