2.x: fix doOnNext failure not triggering doOnError when fused#5415
2.x: fix doOnNext failure not triggering doOnError when fused#5415akarnokd merged 2 commits intoReactiveX:2.xfrom
Conversation
| } catch (Throwable exc) { | ||
| throw new CompositeException(ex, exc); | ||
| } | ||
| throw ExceptionHelper.<Exception>throwIfThrowable(ex); |
There was a problem hiding this comment.
Hmm I don't understand why we both signal onError and also re-throw. It seems like it should be one or the other, no?
There was a problem hiding this comment.
Because this matches how doOnError would be called with the upstream error and then that error is forwarded to the next operator.
Codecov Report
@@ Coverage Diff @@
## 2.x #5415 +/- ##
==========================================
+ Coverage 96.1% 96.2% +0.09%
- Complexity 5778 5794 +16
==========================================
Files 630 630
Lines 41197 41232 +35
Branches 5728 5728
==========================================
+ Hits 39593 39667 +74
+ Misses 631 612 -19
+ Partials 973 953 -20
Continue to review full report at Codecov.
|
| * @throws E the generic exception thrown | ||
| */ | ||
| @SuppressWarnings("unchecked") | ||
| public static <E extends Throwable> Exception throwIfThrowable(Throwable e) throws E { |
There was a problem hiding this comment.
@CheckReturnValue
| * @throws E the generic exception thrown | ||
| */ | ||
| @SuppressWarnings("unchecked") | ||
| public static <E extends Throwable> Exception throwIfThrowable(Throwable e) throws E { |
There was a problem hiding this comment.
Maybe throwIfThrowableOrReturn?
This PR fixes an issue when in a fused chain of
doOnNextanddoOnErrorthedoOnNextfunction fails, thedoOnErrorconsumer is not called.Originally reported in Reactor-Core: reactor/reactor-core#664