RetryInterceptorSpec
A spec for configuring an Interceptor that retries requests based on the specified retry conditions.
Functions
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract fun on(predicate: (RetryContext<*>) -> Boolean, requestModifier: RetryContext<*>.() -> <Error class: unknown class> = { request() })
Link copied to clipboard
abstract fun onException(exceptionPredicate: (Throwable) -> Boolean, requestModifier: RetryContext<*>.() -> <Error class: unknown class> = { request() })
abstract fun onException(exceptionTypes: Set<KClass<out Throwable>>, requestModifier: RetryContext<*>.() -> <Error class: unknown class> = { request() })
Link copied to clipboard
inline fun <T : Throwable> RetryInterceptorSpec.onException(noinline requestModifier: RetryContext<*>.() -> <Error class: unknown class> = { request() }): <Error class: unknown class>
Retries when an exception of type T is thrown. Equivalent to onException(setOf(T::class), requestModifier).
Link copied to clipboard
abstract fun onResponse(responsePredicate: (<Error class: unknown class><T>) -> Boolean, requestModifier: RetryContext<*>.() -> <Error class: unknown class> = { request() })
Link copied to clipboard
abstract fun onStatus(statusPredicate: (Int) -> Boolean, requestModifier: RetryContext<*>.() -> <Error class: unknown class> = { request() })
abstract fun onStatus(codes: Set<Int>, requestModifier: RetryContext<*>.() -> <Error class: unknown class> = { request() })
Link copied to clipboard