In the code below function f returns Single<String>
,
Observable.map { line ->
f(line).doOnError { e ->
println("Error:$e")
}
}
.subscribe({ record -> println(record) }, { e -> println("Error2:$e") })
println("Error:$e")
inside the map won't execute, however I will be able to get the error printed in the subscriber. It looks like that the chaining inside the mapper function in not allowed. Is it correct? If yes, why?
Edit: Also tried flatmap, but same result.
Observable.flatmap { line ->
f(line).toObservable().doOnError { e ->
println("Error:$e")
}
}
.subscribe({ record -> println(record) }, { e -> println("Error2:$e") })