-
Notifications
You must be signed in to change notification settings - Fork 84
Improve Error system #70
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
Conversation
Add the error type to the public interface and add a code for each different type of error to let library users translate errors if they need to.
Add type for the error code and documentation
Checking how this change proposal is received. |
Thanks for your contribution @gsempe, I haven’t had a chance to review it yet |
No worries, I'm at your disposal if you need anythiing |
Hi @cbroglie, I'm checking on my different dependencies and I was thinking to ask for news from the project. |
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.
Please include a test case using errors.As
to extract a ParseError
and verify its fields. Looking good otherwise!
I have added a new test on ParseError unwrapping based on the malformed tests. What do you think about this new test? |
The build is failing here due to issues resolved in #78, do you mind rebasing this with latest master? |
Done 🙌 |
Codecov Report
@@ Coverage Diff @@
## master #70 +/- ##
==========================================
- Coverage 82.56% 82.08% -0.49%
==========================================
Files 2 3 +1
Lines 654 681 +27
==========================================
+ Hits 540 559 +19
- Misses 86 94 +8
Partials 28 28
Continue to review full report at Codecov.
|
Thanks @gsempe, I released v1.4.0 with these changes |
As a library user, we needed a way to translate error messages coming from the library.
This pull request introduces a way to let library users customize error messages if they want. It is as well fully retro-compatible as it doesn't change the current error messages.
What the pull request changes:
Reason
attribute for errors cases that need the name of the entity generating the errorLine
,Code
andReason
attribute public to let library users customize (translate) error message