Package ratpack.retrofit
Class RatpackRetrofitCallException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- ratpack.retrofit.RatpackRetrofitCallException
-
- All Implemented Interfaces:
Serializable
public class RatpackRetrofitCallException extends Exception
Exception throw from Retrofit clients when using simple types instead ofResponse
and the request is not successful.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description RatpackRetrofitCallException(okhttp3.Request request, Response<?> response)
Create a wrapped Retrofit exception.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static RatpackRetrofitCallException
cause(Call<?> call, Response<?> response)
ReceivedResponse
getResponse()
Get the underlying response that resulted in the exception for this HTTP request.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
RatpackRetrofitCallException
public RatpackRetrofitCallException(okhttp3.Request request, Response<?> response)
Create a wrapped Retrofit exception.- Parameters:
request
- the RetrofitRequest
that initiated HTTP request.response
- the underlying RetrofitResponse
from the HTTP request.- Since:
- 1.6.0
-
-
Method Detail
-
getResponse
public ReceivedResponse getResponse()
Get the underlying response that resulted in the exception for this HTTP request. This is useful for mapping the exception based on the response information.- Returns:
- The response for the HTTP call.
- Since:
- 1.6.0
-
cause
public static RatpackRetrofitCallException cause(Call<?> call, Response<?> response) throws IOException
- Throws:
IOException
-
-