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

Add catchOnly to ApplicativeError. #3165

Merged
merged 2 commits into from
Nov 26, 2019

Conversation

takayahilton
Copy link
Contributor

@takayahilton takayahilton commented Nov 20, 2019

No description provided.

@codecov-io
Copy link

codecov-io commented Nov 20, 2019

Codecov Report

Merging #3165 into master will decrease coverage by 0.04%.
The diff coverage is 100%.

Impacted file tree graph

@@            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
Flag Coverage Δ
#scala_version_212 93.32% <100%> (-0.03%) ⬇️
#scala_version_213 90.59% <100%> (-0.05%) ⬇️
Impacted Files Coverage Δ
core/src/main/scala/cats/instances/try.scala 96.72% <100%> (+0.11%) ⬆️
core/src/main/scala/cats/ApplicativeError.scala 86.2% <100%> (-13.8%) ⬇️
core/src/main/scala/cats/data/Kleisli.scala 90.82% <0%> (-0.09%) ⬇️
...n/scala/cats/kernel/instances/QueueInstances.scala 100% <0%> (ø) ⬆️
...in/scala/cats/kernel/instances/ListInstances.scala 100% <0%> (ø) ⬆️
core/src/main/scala/cats/data/Validated.scala 100% <0%> (ø) ⬆️
.../scala/cats/kernel/instances/VectorInstances.scala 100% <0%> (ø) ⬆️
core/src/main/scala/cats/MonadError.scala 100% <0%> (ø) ⬆️
.../scala/cats/kernel/instances/OptionInstances.scala 100% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 55c48a8...9aa0b33. Read the comment docs.

@travisbrown
Copy link
Contributor

Looks reasonable to me.

@travisbrown travisbrown added this to the 2.1.0-RC2 milestone Nov 22, 2019
LukaJCB
LukaJCB previously approved these changes Nov 25, 2019
// this is a somewhat bogus test:
res should not be (null)
}
}
Copy link
Member

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?

@travisbrown travisbrown merged commit 2084a2a into typelevel:master Nov 26, 2019
@takayahilton takayahilton deleted the add-catchOnly-monad-error branch November 26, 2019 07:54
Comment on lines +221 to +222
def catchOnly[T >: Null <: Throwable]: CatchOnlyPartiallyApplied[T, F, E] =
new CatchOnlyPartiallyApplied[T, F, E](this)
Copy link
Contributor

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?

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

Successfully merging this pull request may close these issues.

6 participants