-
Notifications
You must be signed in to change notification settings - Fork 558
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
Unify error wrapping #3237
Comments
Are there any other benefits for the CLI of not using the standard Go errors? I mean, beyond the stack trace support. If the only real benefit is just the stack trace support and we decide is something really helpful maybe we could just implement it ourselves instead of adding a dependency for that. Alternatively wrapping errors coming from Go stdlib, third party packages and |
on this, |
So, after discussing, the team will looking to unify error handling with using This is correct right? |
As far as I know. Lets wait for @tbruyelle confirmation. |
Context
Summary
We have inconsistent use of error wrapping throughout the codebase, mainly a mix between:
fmt.Errorf()
errors.Wrap()
frompkg/errors
It makes sense to just choose one of these ways of handling errors. From the discussion on discord, there are advantages in using
errors.Wrap()
as it includes a stack trace to be optionally displayed to users - helpful for debugging.pkg/errors is now archived and no longer maintained, so there is another project, https://github.com/cockroachdb/errors, that is currently maintained and is a drop-in replacement with some added functionality.
The text was updated successfully, but these errors were encountered: