-
Notifications
You must be signed in to change notification settings - Fork 52
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
feat: wrap external errors instead of changing them to root errors #84
Conversation
I added a test using the Golang |
586ea40
to
84d36c2
Compare
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.
Reminder to update the readme to reflect external error handling changes
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.
we may need to modify/add examples
Since we are adding external error in root error, the New() method should be capable of the same. I should be able to create a new root error from external error. what do you think? |
Reviewed the code, reviewing the tests locally |
wouldn't that be equivalent to wrapping an external error? i think the method definition would look something like |
It won't be equivalent to wrapping because the wrap method returns wrap error type and the proposed method would return root error type |
that's actually incorrect. for the external error case, wrap returns a root error. https://github.com/rotisserie/eris/pull/84/files#diff-0bccded79c042f8676aa4c5a07863306R78 |
Codecov Report
@@ Coverage Diff @@
## master #84 +/- ##
==========================================
- Coverage 98.91% 98.90% -0.02%
==========================================
Files 3 3
Lines 277 274 -3
==========================================
- Hits 274 271 -3
Misses 1 1
Partials 2 2
Continue to review full report at Codecov.
|
cc3ea77
to
59d1900
Compare
this PR is a redesign of the way eris wraps external errors. instead of unwrapping them and disguising them as root errors, it simply wraps them to maintain all error context. closes #82 and closes #81.