Multiple doOnError with retryWhen
<p>I have the following observable Chain:</p>

<pre><code> public &lt;T&gt; Observable&lt;T&gt; request(Observable&lt;T&gt; request) {
        return request.subscribeOn(Schedulers.newThread())
                .observeOn(AndroidSchedulers.mainThread())
                .doOnSubscribe(() -&gt; {
                    errorView.setVisibility(View.INVISIBLE);
                    progressBar.setVisibility(View.VISIBLE);
                    setVisibility(VISIBLE);
                })
                .doOnError(throwable -&gt; {
                    progressBar.setVisibility(View.INVISIBLE);
                    errorView.setVisibility(View.VISIBLE);
                })
                .doOnCompleted(() -&gt; setVisibility(GONE))
                .retryWhen(o -&gt; this.onClick());
    }
</code></pre>

<p>I pass my request Observable as parameter, as you can see I have a <code>doOnError</code> and <code>retryWhen</code> in the chain. What I want is to add another error handler in the request Observable (the parameter). I tried to subscribe to <code>doOnError</code> before it pass to the function and also <code>after</code> but neither of them worked.</p>