2.x: wrap undeliverable errors#5080
Merged
akarnokd merged 2 commits intoReactiveX:2.xfrom Feb 8, 2017
Merged
Conversation
Codecov Report@@ Coverage Diff @@
## 2.x #5080 +/- ##
============================================
- Coverage 95.58% 95.57% -0.02%
- Complexity 5537 5552 +15
============================================
Files 612 614 +2
Lines 39561 39580 +19
Branches 5553 5559 +6
============================================
+ Hits 37816 37827 +11
- Misses 760 772 +12
+ Partials 985 981 -4
Continue to review full report at Codecov.
|
JakeWharton
approved these changes
Feb 8, 2017
| @@ -0,0 +1,35 @@ | |||
| /** | |||
| * Copyright (c) 2016-present, RxJava Contributors. | |||
Member
Author
There was a problem hiding this comment.
All our headers are like this, no current year.
| @@ -0,0 +1,35 @@ | |||
| /** | |||
| * Copyright (c) 2016-present, RxJava Contributors. | |||
| * @return true if the error should pass throug, false if | ||
| * it may be wrapped into an UndeliverableException | ||
| */ | ||
| static boolean isBug(Throwable error) { |
Contributor
There was a problem hiding this comment.
Shouldn't CompositeException be in here as well? While technically they're always undeliverable, they're very crash-worthy exceptions since they indicate an error while processing an error.
Member
Author
There was a problem hiding this comment.
Updated. A few tests have been reverted from assertUndeliverable to assertError. I've also added an isBug unit test.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds the
UndeliverableExceptionandProtocolViolationException. The former wraps exceptions that happen beyond the lifecycle of a flow and the latter is added to distinguish validation bugs.The
RxJavaPlugins.onErrorwraps errors intoUndeliverableExceptionunlessRxJavaPlugins.isBug()returns true when theThrowableis relayed to the (default) handler.Having the
UndeliverableExceptionshould help with understanding the source of a crash and by having its own stack trace, help locating the offending positions (for example, a missedisDisposed()check in a 3rd party library).