I have a list of items say for example list of integers, if any of the integer is null, i need to consume the error and proceed with the next item
For example
Observable.fromIterable(listOf(1, 2, 3, null, 5))
.map {
doSomeProcess(it)
}
.onErrorReturnItem(-1)
.subscribeBy(
onNext = {
print(it)
},
onError = {
},
onComplete = {
})
I am expecting the output like this
1
2
3
-1
5
But my problem is after -1
it is not getting proceeded with item 5
, it stops there, Can anyone help me out with this ?