-
Notifications
You must be signed in to change notification settings - Fork 92
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
Fix uninitialized error detection #36
base: master
Are you sure you want to change the base?
Fix uninitialized error detection #36
Conversation
@dsoprea this is technically a breaking change, though I think the impact is likely to be low. As someone who uses the library a lot I'm curious to hear your opinion on whether we should make a change like this? |
Incorporate fix for go-errors#36
@ConradIrwin FWIW, this issue through me for a loop. I'm switching a project over from vanilla errors, and got stuck chasing down nil != nil. I hoped to find this exact issue, which of course I did. It's a little awkward to work around, but not a lot of work. I think the bigger issue is cognitive. The module does not work as I would expect, especially when I crack open the Wrap function and see:
I would call this a gotcha. ty for sharing the module! |
Hey! Sorry for the slow reply here! I may be misunderstanding the use-case here, but I expect people who are using go-errors to wrap errors returned by a function, and in go it is idiomatic to have functions that return an error to return an interface type If you have a function that returns an interface type error then in order for Is there a use-case I'm not thinking about that causes this to break, or is it legacy code that is returning untyped nil (in which case probably the right fix is to update the function that's returning a typed nil error). |
Sorry to dig up an old issue but I hit this and would like to further it. There's been more discussion here vs the open issue so I'm choosing to post here.
I want this to return a nil What I mean to emphasize is: this issue breaks the internal consistency of the go-errors library. |
I discovered #33 after the fact and see that changing functions to return |
Well… can we make new functions WrapError or the like that return |
This should address issue #35