https://kotlinlang.org logo
#rx
Title
l

leosan

11/15/2017, 2:11 PM
@viliusk you can compose your stream to deal with the networking error as @alex.hart suggested but you shouldn't be finishing your upstream on networking error basically because what you want keep listening to your stream until your view is destroyed
v

viliusk

11/15/2017, 2:12 PM
how do I prevent from finishing the upstream?
Just handing errors and returning some other type of objects?
l

leosan

11/15/2017, 2:15 PM
let me check your code
K 1
l

leosan

11/15/2017, 2:21 PM
so basically on your
getMemberDetails
instead of
doOnError
use
onErrorResumeNext()
and then you return something to your main stream
like an empty character or something that will not crash your stream
v

viliusk

11/15/2017, 2:35 PM
Or could I return a new
ErrorResponse
object with parsed error message?
l

leosan

11/15/2017, 2:43 PM
anything that is not an error it you be passed to your stream and ending on the
onNext
not sure if you want that
think in something like that
Copy code
Flowable.just(1,2,3)
     .subscribe({int-> print(int+1})
and then you add an 4th element but is an parsed error
it will try to do calculation and crash
a

alex.hart

11/15/2017, 2:52 PM
onErrorResumeNext takes a new stream, doesn’t it? Replaces the old “Error terminated” stream with the new one
👍 1
Also, I believe onErrorReturn will complete the stream after emitting the value passed in
👍 1
3 Views