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

Support for improved error handling >= go 1.13 #8

Open
simitt opened this issue Mar 24, 2020 · 1 comment
Open

Support for improved error handling >= go 1.13 #8

simitt opened this issue Mar 24, 2020 · 1 comment

Comments

@simitt
Copy link
Contributor

simitt commented Mar 24, 2020

Add support for

@segevfiner
Copy link

zap opted to avoid handling this by itself. Relying on formatting the error with %+v into errorVerbose , which means the error type needs to implement that to be printed nicely by it. (With no documentation on how to do so properly, and with each library doing it slightly differently, yay Go!). That doesn't mean it can't be done of course. Just something to know about.

Another thing is that due to Go deficiencies it is common to wrap errors with various error wrappers that add things like a stack trace (e.g. github.com/pkg/errors.WrapStack). By just walking the error chain, you will also walk over that type, which delegates to the wrapped error and will cause its message to be printed twice unless it will be handled specially.

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