-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Exception thrown from onError() is swallowed when using groupBy/flatMap #2998
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
Comments
You shouldn't throw from |
I see, so I shouldn't use exception thrown from |
If we are swallowing an error that's a bug. |
It would be helpful it someone can create a failing unit test for this issue that demonstrates where the exception is being swallowed. |
|
Please let me know if someone is going to fix this. Sorry, I don't feel that I can fix this myself - concurrency is not my strongest skill. |
This has nothing to do with concurrency but with fault tolerance. The problem is that if the call to onError throws, there is no clear path that could propagate the exception out of the operator chain. For example, if an |
I think that a clean way to do this could be creation of |
That works until the first async boundary where it will probably be swallowed by the |
How does |
Most exception blocks around onNext and callbacks use |
How about wrapping only subscriber's |
Could work. Could you post a PR with the changes and your unit tests to see if it really does? |
I can't build, I think there is something with the windows OS I'm running.
|
I'm developing RxJava under Windows with Eclipse Mars + Gradle plugin without any issues. |
@konmik you need to clone the repo from git and not just download zip. The build plugins require that the project be build from inside of a git repo. |
Thanks, @JakeWharton. It looks like we already have the required The first idea is to comment some lines out to allow public static void throwIfFatal(Throwable t) {
if (t instanceof OnErrorNotImplementedException) {
throw (OnErrorNotImplementedException) t;
} else if (t instanceof OnErrorFailedException) {
// Throwable cause = t.getCause();
// if (cause instanceof RuntimeException) {
// throw (RuntimeException) cause;
// } else {
throw (OnErrorFailedException) t;
// }
} While this does not solve the problem of the I'll spend some time investigating the issue. |
I guess this issue has been fixed in #3455 and delivered in 1.0.15. |
This issue is related to #969, where it has been said that following code should throw exception:
And it does throw exception, but when you add
groupBy
/flatMap
like that:Then the exception is silently swallowed. I tried to debug it a little bit, and seems that it could be because
OnErrorFailedException
is wrapped withCompositeException
, soExceptions.throwIfFatal()
doesn't recognize it as fatal.The text was updated successfully, but these errors were encountered: