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

Encode/decode errors are wrapped as strings #261

Closed
akalin-keybase opened this issue Aug 28, 2018 · 2 comments
Closed

Encode/decode errors are wrapped as strings #261

akalin-keybase opened this issue Aug 28, 2018 · 2 comments

Comments

@akalin-keybase
Copy link

One minor issue that we ran into when updating our fork was that the new error-wrapping behavior would cause tests to break. The tests would expect errors to be of a certain type, but since the returned error was wrapped, we'd have to change it to do string comparisons.

It's not too hard to change the wrapping to preserve the original error, and also to implement the causer interface from https://godoc.org/github.com/pkg/errors , which is the closest thing go has to a standard way of wrapping errors.

I implemented this in keybase#13 (with an example PR that uses it here: keybase/saltpack#67 ). Would there be any interest in merging it upstream?

@ugorji
Copy link
Owner

ugorji commented Aug 28, 2018

Yes, will be happy to upstream this. Please create a CL that I can merge.

Please do not include the encode_test and decode_test.go files - I don't see the value in those tests.

@akalin-keybase
Copy link
Author

Done! #262

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

No branches or pull requests

2 participants