I would like to know how to ignore exceptions and continue infinite stream (in my case stream of locations)?
I\'m fetching current user position (using Android-React
Here is my kotlin extension function for ignoring errors
fun Observable.ignoreErrors(errorHandler: (Throwable) -> Unit) =
retryWhen { errors ->
errors
.doOnNext { errorHandler(it) }
.map { 0 }
}
This utilizes retryWhen
to indefinately re-subscribe to the upstream while still allowing you a method of handling the error in a non terminal way.
This feels dangerous