-
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: add tryOnError to create/XEmitter API #5344
Conversation
Codecov Report
@@ Coverage Diff @@
## 2.x #5344 +/- ##
===========================================
+ Coverage 96.08% 96.18% +0.1%
- Complexity 5770 5782 +12
===========================================
Files 630 630
Lines 41146 41162 +16
Branches 5714 5721 +7
===========================================
+ Hits 39536 39593 +57
+ Misses 633 613 -20
+ Partials 977 956 -21
Continue to review full report at Codecov.
|
RxJavaPlugins.onError(t); | ||
} | ||
} | ||
|
||
@Override |
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.
indentation seems off
|
||
@Test | ||
public void tryOnError() { | ||
for (BackpressureStrategy strategy : BackpressureStrategy.values()) { |
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.
👍
This PR adds the
tryOnError
method to the variousEmitter
types used in thecreate
operators that allows the developer to avoid theUndeliverableException
in case a cancellation is racing with the emission of an error. The return value indicates a success of the delivery; in case offalse
, the developer can decide to log/drop the specific error if that makes sense for him/her.