-
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
Implement new API (from errgroup and multierror) so eris can become ultimate error package. #101
Comments
hey @krhubert, thanks for submitting this! it's going to take a while to consider all of this but at first glance, i'm hesitant about some of these suggestions. will write up a more detailed response and break this into separate issues once i get a chance. thanks again! |
Thanks for submitting the PR. Will take a look over the weekend and get
back to you
…On Mon, Oct 18, 2021 at 10:35 AM Vera Harless ***@***.***> wrote:
hey @krhubert <https://github.com/krhubert>, thanks for submitting this!
it's going to take a while to consider all of this but at first glance, i'm
hesitant about some of these suggestions. will write up a more detailed
response and break this into separate issues once i get a chance. thanks
again!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#101 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKETUQEN6DSINTFMAVKG6DUHQWBNANCNFSM5F7ITZZQ>
.
|
+1 For the append functionality, we ran into this exact use case, where we'd like to wrap an error with another error of ours so we can deal with it ourselves up the stack in a more generic fashion. i.e. we want to map our errors to an http response at some point, so it would be very useful if one could do things like this: object, err := library.GetObject(someID)
if errors.Is(err, library.SpecificNotFoundErr) {
return eris.Append(err, GenericNotFoundErr)
} Which would make it very easy to do things like this. |
Go 1.20 added new method |
Is your feature request related to a problem? Please describe.
Implement new API to have only one error package to manage all common errors related cases/problems.
With this change, I don't have to import other errors packages and eris would become the ultimate solution for almost
all error handling cases.
Describe the solution you'd like
Add/Import more functions and functionalities to this pkg. I've prepared a go docs:
Describe alternatives you've considered
Still using other packages like
github.com/hashicorp/go-multierror
orgolang.org/x/sync/errgroup
Additional context
I know maybe this Issue should be split into smaller ones but I thought it would be easier to gather all this into one Issue.
One real example that shows how
multerror
andWraps
can be used.The text was updated successfully, but these errors were encountered: