Open khaledkhj opened 6 years ago
We can handle that by using onErrorResumeNext
.
Thank you for the prompt reply, but can you please show an example on how to use it?
I tried onErrorResumeNext
without any luck. After InterruptedIOException
it just won't emit. Looks like some ongoing request's Observable is getting unsubscribed at wrong time. Anyone got any idea?
Ok, So for those who are still facing this, I managed to solve this by providing a scheduler to my switchMap
. So unsubscribe
on your previous calls won't affect on your current one.
i had same issue "my subscription terminated once an error is emitted",but this one help me
.switchMap(new Func1<String, Observable<Response>>() {
@Override public Observable<Response> call(String query) {
return retrofitService.search(query)
.onErrorResumeNext(Observable.<Response>empty());
}
})
@khaledkhj @Apsaliya
Any idea how to handle "thread interrupted"?
This happens due to calling the instant search api!
Thank you.