Retrofit API call receives “HTTP FAILED: java.io.IOException: Canceled”

前端 未结 4 963
难免孤独
难免孤独 2021-01-01 09:58

Can\'t figure out why is this happening. Neither one of rx callbacks (onCompleted(), onError(), onNext()) not gets triggered by my call. The only thing i receive is this okh

4条回答
  •  遥遥无期
    2021-01-01 10:31

    That exception gets thrown if the request is cancelled by the user. When using RxJavaCallAdapterFactory this happens if the subscription is unsubscribed before the call can complete. So I guess at some point after you do the call you do subscription.unsubscribe() which cancels the underlying requests.

提交回复
热议问题