-
Notifications
You must be signed in to change notification settings - Fork 7.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2.x: fix doOnNext failure not triggering doOnError when fused #5415
Conversation
} catch (Throwable exc) { | ||
throw new CompositeException(ex, exc); | ||
} | ||
throw ExceptionHelper.<Exception>throwIfThrowable(ex); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@CheckReturnValue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Internal API.
* @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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe throwIfThrowableOrReturn
?
This PR fixes an issue when in a fused chain of
doOnNext
anddoOnError
thedoOnNext
function fails, thedoOnError
consumer is not called.Originally reported in Reactor-Core: reactor/reactor-core#664