-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Actual exception is being hidden by OnErrorFailedException #3679
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 shoudn't throw from |
This is just an example to illustrate the problem, my point was not that there shouldn't be exception, my point is that the cause exception that Instead the log is of an exception which is already handled. This is confusing and can take a lot of time to understand and to find the actual cause. For example, in my app there is a rare bug somewhere inside my If you run the same example above with the
|
Simpler way to reproduce is to just throw within a
|
I see this issue too. When I see logs via crashlytics the stacktrace just shows the composite exception but not the details of the actual crash in |
The cause of ReactiveX#3679 is we use a wrong Throwable (its cause has been set) to set the cause and `initCause` will throw an exception. Hence, the cause chain is not created correctly. In this PR, it searchs the root cause (which doesn't have a cause) and use it to call `initCause`.
The cause of ReactiveX#3679 is we use a wrong Throwable (its cause has been set) to set the cause and `initCause` will throw an exception. Hence, the cause chain is not created correctly. In this PR, it searches the root cause (which doesn't have a cause) and use it to call `initCause`.
The cause of ReactiveX#3679 is we use a wrong Throwable (its cause has been set) to set the cause and `initCause` will throw an exception. Hence, the cause chain is not created correctly. In this PR, it searches the root cause (which doesn't have a cause) and use it to call `initCause`.
Closing via #3977 |
Using RxJava 1.10 (and similar issue on 1.0.15), I stumbled upon a mysterious stack trace that made no sense in my app, after a lot of debugging, I found that RxJava will report the wrong exception in some scenarios. For example, if you run this sample code:
The expected behaviour should be that
IllegalThreadStateException
(thrown within theonError
handler of the subscriber) is included as the cause. However, the actual stack trace containsUnsupportedOperationException
as the cause - which is not the problem in the code snippet above. theUnsupportedOperationException
is totally fine, but the problem arises whenonError
throws.This leads to a stack trace that points to the wrong cause and does not include the actual cause (which would be the
IllegalThreadStateException
). If I removed theretryWhen()
block - then the stack trace correctly includesIllegalThreadStateException
as the exception from withinonError
.The (incorrect) trace from the code snippet above:
The text was updated successfully, but these errors were encountered: