Package ratpack.retrofit
Class RatpackRetrofitCallException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- ratpack.retrofit.RatpackRetrofitCallException
-
- All Implemented Interfaces:
java.io.Serializable
public class RatpackRetrofitCallException extends java.lang.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 exceptionRatpackRetrofitCallException(Call<?> call, java.lang.String error)
Deprecated.since 1.6.0
-
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.
-
-
-
Constructor Detail
-
RatpackRetrofitCallException
@Deprecated public RatpackRetrofitCallException(Call<?> call, java.lang.String error)
Deprecated.since 1.6.0Create a wrapped Retrofit exception- Parameters:
call
- the RetrofitCall
to wrap.error
- the error message- See Also:
RatpackRetrofitCallException(Request, Response)
-
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 java.io.IOException
- Throws:
java.io.IOException
-
-