In RX Java there is a possibility to provide a default value in case of error, with a variety of onError... methods.
What is the counterpart in Kotlin coroutines?
I understand I can wrap code inside launch or await calls in try...catch, but maybe there is a better solution?
What I need to convert this RX code to coroutines:
Single.zip(
call1().onErrorResumeNext().observeOn(Dispatchers.IO),
call2().onErrorReturnItem(DummyObject()).observeOn(Dispatchers.IO),
call3().observeOn(Dispatchers.IO),
result1, result2, result3 -> [zipper func]
)
And I don't see an attractive solution for that.
You can do all in
catch{}operator:throwemitnew value