-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add catchOnly to ApplicativeError. #3165
Add catchOnly to ApplicativeError. #3165
Conversation
8153a8c
to
240241e
Compare
240241e
to
6d04326
Compare
Codecov Report
@@ Coverage Diff @@
## master #3165 +/- ##
==========================================
- Coverage 93.04% 92.99% -0.05%
==========================================
Files 376 376
Lines 7374 7381 +7
Branches 209 195 -14
==========================================
+ Hits 6861 6864 +3
- Misses 513 517 +4
Continue to review full report at Codecov.
|
Looks reasonable to me. |
// this is a somewhat bogus test: | ||
res should not be (null) | ||
} | ||
} |
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.
Might it be useful to also test that catchOnly
on an unrelated exception does not catch?
def catchOnly[T >: Null <: Throwable]: CatchOnlyPartiallyApplied[T, F, E] = | ||
new CatchOnlyPartiallyApplied[T, F, E](this) |
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.
Out of curiosity... I'm struggling to understand this.
What was the T >: Null
constraint added for in there? To me it seems that due to the latter constraint T <: Throwable
the former one will be always satisfied automatically, won't it? This is because Throwable
is AnyRef
and Null <: T <: AnyRef
for any T
.
Or am I missing something?
@takayahilton could you clarify please?
No description provided.