Class ErrorHandlingExecutorCallAdapterFactory
java.lang.Object
retrofit2.CallAdapter.Factory
com.netflix.spinnaker.kork.retrofit.ErrorHandlingExecutorCallAdapterFactory
public class ErrorHandlingExecutorCallAdapterFactory
extends retrofit2.CallAdapter.Factory
RetrofitError and ErrorHandler are no longer present in
retrofit2. So this class helps to achieve similar logic as retrofit and handle exceptions
globally in retrofit2. This can be achieved by setting this class as CallAdapterFactory at the
time of Retrofit client creation.-
Method Summary
Modifier and TypeMethodDescriptionretrofit2.CallAdapter<?,?> get(Type returnType, Annotation[] annotations, retrofit2.Retrofit retrofit) Returns a call adapter for interface methods that returnreturnType, or null if returnType is not instance ofCallandParameterizedType.getInstance(Executor callbackExecutor) Methods inherited from class retrofit2.CallAdapter.Factory
getParameterUpperBound, getRawType
-
Method Details
-
getInstance
-
getInstance
-
get
@Nullable public retrofit2.CallAdapter<?,?> get(Type returnType, Annotation[] annotations, retrofit2.Retrofit retrofit) Returns a call adapter for interface methods that returnreturnType, or null if returnType is not instance ofCallandParameterizedType.- Specified by:
getin classretrofit2.CallAdapter.Factory
-