-
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: reintroduce OnErrorNotImplementedException for 0-1 argument subscribe() #5036
Conversation
Coverage: 95.51% |
(Messing with codecov settings, had to reopen this to trigger a webhook of theirs.) |
I couldn't get Travis re-execute the job, likely due to the problems they are facing right now (even though they claim its only MacOSX builds). |
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.
👍
So for the application usage it makes sense to re-throw everything of instance of My app became quite unstable with RxJava 2 because I'm silently swallowing errors and can't distinguish between my errors and errors thrown after I unsubscribed. Really looking forward for this change if it does what I think it does! |
If you are using |
@@ -1702,6 +1702,10 @@ public final Disposable subscribe(final Action onComplete, final Consumer<? supe | |||
* Subscribes to this Completable and calls the given Action when this Completable | |||
* completes normally. | |||
* <p> | |||
* If the Completable emits an error, it is wrapped into an |
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.
Now it's twice.
If the completable emits an error...
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.
Once with the note about OnErrorNotImplemented..., once as swallowed
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.
Great opportunity to post a PR!
This PR reintroduces the
OnErrorNotImplementedException
wrapper from 1.x and applies it to thesubscribe()
methods that don't define anonError
handler.The errors are still routed to the
RxJavaPlugins.onError
handler but now wrapped withOnErrorNotImplementedException
.This should help with cases where the developer forgot to add the handler and distinguish such unhandled errors from other undeliverable errors due to lifecycle limitations.