onErrorReturn

fun <T : Any> Call<T>.onErrorReturn(scope: CoroutineScope, function: suspend (originalError: StreamError) -> Result<T>): ReturnOnErrorCall<T>

Wraps this Call into ReturnOnErrorCall to return an item specified by side effect function when it encounters an error.

Parameters

scope

Scope of coroutine in which to execute side effect function.

function

Function that returns data in the case of error.