-
Notifications
You must be signed in to change notification settings - Fork 545
Accumulation errors #1243
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
base: series/0.14.x
Are you sure you want to change the base?
Accumulation errors #1243
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1243 +/- ##
==========================================
- Coverage 86.44% 85.96% -0.49%
==========================================
Files 92 92
Lines 2863 2879 +16
Branches 119 118 -1
==========================================
Hits 2475 2475
- Misses 388 404 +16
Continue to review full report at Codecov.
|
|
I want to go ahead and publish 0.12.0, but we'll work through this in the 1.0.0 milestones. |
|
That sounds good. |
| */ | ||
| sealed abstract class DecodingFailure(val message: String) extends Error { | ||
| sealed trait DecodingFailure extends Error { | ||
| val message: String |
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.
Why not add the def withMessage(message: String): DecodingFailure method here?
| _.map( | ||
| e => | ||
| e match { | ||
| case e: SingleDecodingFailure => e.withMessage(message) |
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.
You could just flatten this to:
_.map {
case e: SingleDecodingFailure => e.withMessage(message)
case e: AggregatedDecodingFailure => e.withMessage(message)
}
A conjecture of an approach, I suspect most of the accumulator code can instead be removed and rewritten in terms of this mechanic.
Needs a bit more of the replication of a case class machinery that the SingleDecodingFailure has, but as you can see in the added test, makes it very easy to do error accumulation.