Guilherme Torres Castro
Guilherme Torres Castro

Reputation: 15350

RxJava retryWhen and onError

I am starting to developing using rxJava, and I have the following situation:

I have a observable and I want to have one subscriber to handle the error onError, and other subscriber to handle the retryWhen.

The retryWhen swallow the error, how avoid the error swallow?

Upvotes: 0

Views: 567

Answers (1)

zsxwing
zsxwing

Reputation: 20816

You can put doOnError/doOnEach before retryWhen like this:

    o.doOnError(t -> {
      // do something 
    }).retryWhen(o -> {
      // do something
    });

Upvotes: 4

Related Questions