search

Home  >  Q&A  >  body text

android - rajava,retrofit一个页面多个不相干请求

一个页面包含4个不相干请求,如果用 rxjava 的 merge 或者 zip 会出现一个问题,就是如果其中一个请求报错了,其他的请求也无法继续。请问有办法解决吗?

阿神阿神2819 days ago617

reply all(2)I'll reply

  • ringa_lee

    ringa_lee2017-04-18 09:30:01

    If an error is reported, the onError method must be executed. There is an error handling function catch in RxJava, such as onErrorReturn() or onErrorResumeNext() or onExceptionResumeNext(). My idea is that if an error occurs, intercept it. Will this not affect other requests? As for request errors, you can add a retry mechanism.

    reply
    0
  • 迷茫

    迷茫2017-04-18 09:30:01

    Observable.mergeDelayError

    reply
    0
  • Cancelreply