public final class RequestError
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
RequestError.Builder
Builds an APIError.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
static RequestError |
errorFromResponse(java.lang.String body,
java.lang.String contentType)
Create an APIError from the response if it conforms to the API v3
Currently, three types of error bodies are returned, text/html strings,
basic JSON errors {"error":"message"} and the v3 error spec.
|
java.util.Optional<RequestErrorDetails> |
getDetails()
Returns the details of this error if error details are available from the
API.
|
java.lang.String |
getError()
Returns a description of the error
|
java.util.Optional<java.lang.Number> |
getErrorCode()
Returns an error code specific to the Urban Airship.
|
boolean |
getOk() |
java.util.Optional<java.lang.String> |
getOperationId()
Returns the operation id for the error.
|
int |
hashCode() |
static RequestError.Builder |
newBuilder()
Returns a APIError Builder
|
java.lang.String |
toString() |
public static RequestError errorFromResponse(java.lang.String body, java.lang.String contentType) throws java.io.IOException
body
- Response body for the request that caused the exceptioncontentType
- Stringjava.io.IOException
- if it fails reading the errorpublic static RequestError.Builder newBuilder()
public boolean getOk()
public java.util.Optional<java.lang.String> getOperationId()
public java.lang.String getError()
public java.util.Optional<java.lang.Number> getErrorCode()
public java.util.Optional<RequestErrorDetails> getDetails()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object