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 withContext to improve error reporting #194
Conversation
Codecov Report
@@ Coverage Diff @@
## main #194 +/- ##
==========================================
+ Coverage 95.63% 96.18% +0.54%
==========================================
Files 7 7
Lines 939 969 +30
Branches 79 96 +17
==========================================
+ Hits 898 932 +34
+ Misses 41 37 -4
Continue to review full report at Codecov.
|
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.
Looks good to me! Although some test with an example and not as much logic as in the existing prop tests would be nice.
/** This is a reverse order stack (most recent context first) | ||
* of this parsing error | ||
*/ | ||
def context: List[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.
Can we make this tailrec
? It'd probably require a reverse
at the end but maybe it's worth pursuing?
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.
Seems to me if your errors are so nested you blow the stack here you will have other issues. I don't think it is worth a cost to retain the ability of having 50k deep nested contexts.
What do you think?
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.
Fair. Let's leave it ;)
This is published as part of 0.3.3 |
close #43
This follows the design sketched in the issue above. The goals are:
cc @kubukoz @mpilquist