The onErrorResumeNext operator helps you subscribe to a different producer in case any error occurs.
Here is an example:
fun main(args: Array<String>) { Observable.just(1,2,3,4,5) .map { it/(3-it) } .onErrorResumeNext(Observable.range(10,5))//(1) .subscribe { println("Received $it") } }
The output is as follows:
This operator is especially useful when you want to subscribe to another source producer in case any error occurs.