public class RetrofitError extends RuntimeException
Modifier and Type | Class and Description |
---|---|
static class |
RetrofitError.Kind
Identifies the event kind which triggered a
RetrofitError . |
Modifier and Type | Method and Description |
---|---|
static RetrofitError |
conversionError(String url,
Response response,
Converter converter,
Type successType,
ConversionException exception) |
Object |
getBody()
HTTP response body converted to the type declared by either the interface method return type
or the generic type of the supplied
Callback parameter. |
Object |
getBodyAs(Type type)
HTTP response body converted to specified
type . |
RetrofitError.Kind |
getKind()
The event kind which triggered this error.
|
Response |
getResponse()
Response object containing status code, headers, body, etc.
|
Type |
getSuccessType()
The type declared by either the interface method return type or the generic type of the
supplied
Callback parameter. |
String |
getUrl()
The request URL which produced the error.
|
static RetrofitError |
httpError(String url,
Response response,
Converter converter,
Type successType) |
boolean |
isNetworkError()
Deprecated.
|
static RetrofitError |
networkError(String url,
IOException exception) |
static RetrofitError |
unexpectedError(String url,
Throwable exception) |
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public static RetrofitError networkError(String url, IOException exception)
public static RetrofitError conversionError(String url, Response response, Converter converter, Type successType, ConversionException exception)
public static RetrofitError httpError(String url, Response response, Converter converter, Type successType)
public static RetrofitError unexpectedError(String url, Throwable exception)
public String getUrl()
public Response getResponse()
@Deprecated public boolean isNetworkError()
getKind() == Kind.NETWORK
.public RetrofitError.Kind getKind()
public Object getBody()
Callback
parameter. null
if there is no
response.RuntimeException
- if unable to convert the body to the success
type
.public Type getSuccessType()
Callback
parameter.public Object getBodyAs(Type type)
type
. null
if there is no response.RuntimeException
- if unable to convert the body to the specified type
.Copyright © 2015 Square, Inc.. All Rights Reserved.