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

RxJavaErrorHandler does not get invoked when onErrorResumeNext/onErrorReturn/... are involved #1215

Closed
mattrjacobs opened this issue May 19, 2014 · 3 comments

Comments

@mattrjacobs
Copy link
Contributor

The RxJavaErrorHandler only gets invoked in SafeSubscriber._onError(ex). Given the use of operators as of RxJava 0.17.x, onErrors caught and handled by the onErrorResumeNext/onErrorReturn/... patterns don't propagate out to SafeSubscriber, and never get handled.

@abersnaze
Copy link
Contributor

One of solutions that we came up with was to add logic to onError.*() methods to report the errors to the plugin before allowing the closure the chance to ignore them. I'm not a fan of this one because it could lead to double reporting of errors.

error(new Exception()).onErrorResumeNext(e -> concat(just(null), error(e)))

Another idea was to wrap the invocation of all user code to handle exceptions in a consistent way across of the Rx codebase. This would be a huge change and makes the assumption that the Rx code is prefect with regards to exception handling. As an experiment I changed the signature of Func0...N and Action0...N to call(...) throws Throwable and was greeted with thousands of errors. There are lots of places where an operator invokes a closure without garding against it failing.

@mattrjacobs
Copy link
Contributor Author

Now tracked by Pull Request #1306

@benjchristensen
Copy link
Member

Done in #1306

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

No branches or pull requests

3 participants