retrofit
Class RetrofitError

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by retrofit.RetrofitError
All Implemented Interfaces:
Serializable

public class RetrofitError
extends RuntimeException

See Also:
Serialized Form

Method Summary
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.
 Response getResponse()
          Response object containing status code, headers, body, etc.
 String getUrl()
          The request URL which produced the error.
static RetrofitError httpError(String url, Response response, Converter converter, Type successType)
           
 boolean isNetworkError()
          Whether or not this error was the result of a network error.
static RetrofitError networkError(String url, IOException exception)
           
static RetrofitError unexpectedError(String url, Throwable exception)
           
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

networkError

public static RetrofitError networkError(String url,
                                         IOException exception)

conversionError

public static RetrofitError conversionError(String url,
                                            Response response,
                                            Converter converter,
                                            Type successType,
                                            ConversionException exception)

httpError

public static RetrofitError httpError(String url,
                                      Response response,
                                      Converter converter,
                                      Type successType)

unexpectedError

public static RetrofitError unexpectedError(String url,
                                            Throwable exception)

getUrl

public String getUrl()
The request URL which produced the error.


getResponse

public Response getResponse()
Response object containing status code, headers, body, etc.


isNetworkError

public boolean isNetworkError()
Whether or not this error was the result of a network error.


getBody

public 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.


getBodyAs

public Object getBodyAs(Type type)
HTTP response body converted to specified type.



Copyright © 2013 Square, Inc.. All Rights Reserved.