Skip to content
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

fix #5468: eager hooks onError call #5470

Conversation

DeepSpawn
Copy link

Move the call to RxJavaHooks into the catch block, so we only report and it if the underlying subscriber throws in its onError method.

This brings its behaviour in line with that of SafeSubscriber

Move the call to RxJavaHooks into the catch block, so we only report it if the underlying subscriber throws in its onError method.
This brings the behaviour in line with that of SafeSubscriber, which only call Hooks.onError inside the catch
@DeepSpawn
Copy link
Author

Not sure if this change warrants a unit test, but I am happy to add them if you think it is necessary

@@ -54,7 +54,6 @@ public void onCompleted() {

@Override
public void onError(Throwable e) {
RxJavaHooks.onError(e);
if (done) {
return;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should have moved it here.

@@ -63,6 +62,7 @@ public void onError(Throwable e) {
actual.onError(e);
} catch (Throwable ex) {
Exceptions.throwIfFatal(ex);
RxJavaHooks.onError(e);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@akarnokd so this should be in if(done) only?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

@codecov
Copy link

codecov bot commented Jul 6, 2017

Codecov Report

Merging #5470 into 1.x will decrease coverage by 0.1%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##                1.x   #5470      +/-   ##
===========================================
- Coverage     84.41%   84.3%   -0.11%     
+ Complexity     2889    2886       -3     
===========================================
  Files           291     291              
  Lines         18130   18130              
  Branches       2479    2478       -1     
===========================================
- Hits          15304   15285      -19     
- Misses         1961    1973      +12     
- Partials        865     872       +7
Impacted Files Coverage Δ Complexity Δ
...n/java/rx/observers/SafeCompletableSubscriber.java 100% <100%> (ø) 10 <0> (ø) ⬇️
...ain/java/rx/internal/operators/OnSubscribeAmb.java 79.13% <0%> (-5.04%) 13% <0%> (ø)
...ternal/operators/OperatorOnBackpressureLatest.java 79.04% <0%> (-3.81%) 3% <0%> (ø)
...ava/rx/internal/operators/OperatorMaterialize.java 85.24% <0%> (-3.28%) 3% <0%> (ø)
...va/rx/internal/schedulers/EventLoopsScheduler.java 84.84% <0%> (-3.04%) 7% <0%> (ø)
.../java/rx/internal/util/unsafe/MpscLinkedQueue.java 72.72% <0%> (-3.04%) 8% <0%> (-1%)
...c/main/java/rx/observables/BlockingObservable.java 85.61% <0%> (-1.44%) 37% <0%> (-1%)
...n/java/rx/subjects/SubjectSubscriptionManager.java 80.71% <0%> (-1.43%) 15% <0%> (-1%)
...in/java/rx/internal/operators/OperatorGroupBy.java 90.81% <0%> (-0.71%) 5% <0%> (ø)
src/main/java/rx/subjects/UnicastSubject.java 83.95% <0%> (-0.62%) 9% <0%> (ø)
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3e5b117...45046a1. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants