与Single.zip和可能的bindToLifecycle()相关的UndeliverableException

时间:2019-02-20 15:16:13

标签: retrofit2 rx-java2

我最近将我的应用程序更新为RxJava2和RxLifecycle3-我进一步使用Retrofit2。 当我的服务器通过Retrofit和RxJava请求失败时,我现在看到许多UndeliverableExceptions。不幸的是,堆栈跟踪无法显示错误在代码中的何处发生-只是它可能是使用Single.zip()的流。

我在寻找发射器/创建调用onError()的构造,但在我的应用程序中只发现了tryOnError()调用。

是否可能是RxLifecycle的.compose(bindToLifecycle())引起的?我在每个使用此调用的地方都将其放在subscribe()调用的上方。 我知道这种方法会发出onError()来取消流。在这种情况下,Single是否正确放置在上游?放置Single.zip()中的flatmap()操作是否存在问题?

您有任何想法要寻找UndeliverableException的其他模式吗?

Fatal Exception: io.reactivex.exceptions.UndeliverableException: The exception could not be delivered to the consumer because it has already canceled/disposed the flow or the exception has nowhere to go to begin with. Further reading: https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0#error-handling | <Cause Exception Message>
       at io.reactivex.plugins.RxJavaPlugins.onError(RxJavaPlugins.java:367)
       at io.reactivex.internal.operators.single.SingleZipArray$ZipCoordinator.innerError(SingleZipArray.java:139)
       at io.reactivex.internal.operators.single.SingleZipArray$ZipSingleObserver.onError(SingleZipArray.java:175)
       at io.reactivex.internal.operators.single.SingleObserveOn$ObserveOnSingleObserver.run(SingleObserveOn.java:79)
       at io.reactivex.android.schedulers.HandlerScheduler$ScheduledRunnable.run(HandlerScheduler.java:119)
       at android.os.Handler.handleCallback(Handler.java:789)
       at android.os.Handler.dispatchMessage(Handler.java:98)
       at android.os.Looper.loop(Looper.java:164)
       at android.app.ActivityThread.main(ActivityThread.java:6938)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)

0 个答案:

没有答案