title: How to handle errors in an Observable chain conditionally?
body: <p>I am using <a href="http://reactivex.io/documentation/operators/catch.html" rel="nofollow noreferrer"><code>onErrorReturn</code></a> to emit a particular item rather than invoking <code>onError</code> if the observable encounters an error:</p>
  <pre><code>Observable&lt;String&gt; observable = getObservableSource();
  observable.onErrorReturn(error -&gt; &quot;All Good!&quot;)
            .subscribeOn(Schedulers.io())
            .observeOn(Schedulers.trampoline())
            .subscribe(item -&gt; onNextAction(),
                error -&gt; onErrorAction()
            );
  </code></pre>
  <p>This works fine, but I want to consume the error in <code>onErrorReturn</code> <em>only if certain conditions are met</em>. Just like rethrowing an exception from inside a <code>catch</code> block.</p>
  <p>Something like:</p>
  <pre><code>onErrorReturn(error -&gt; {
      if (condition) {
          return &quot;All Good!&quot;;
      } else {
          // Don't consume error. What to do here?
          throw error; // This gives error [Unhandled Exception: java.lang.Throwable]
      }
  });
  </code></pre>
  <p><strong>Is there a way to propagate the error down the observable chain from inside <code>onErrorReturn</code> as if <code>onErrorReturn</code> was never there?</strong></p>