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
proposal: Go 2: counter proposal to error values (v2) #31111
Comments
We agree that
I don't understand this. Errors with stack information will have the same problem as the current proposal. Errors without stack information will not, also the same. The substantive differences seem to be:
Thanks for taking the time to improve and clarify your proposal. Speaking for myself, I don't see anything here that causes me to rethink our current proposal. |
In this proposal wrapping is not an interface but a concrete type, Also in the original while
In this proposal, errors only hold the information of that error. Stack information is an error, namely
Sure. It will be much easier to do here since only |
No, I meant how would
No: except that they have different stack frames. And it isn't necessary that every error implement something, only that the recursive comparison function ignores frames. |
I see. For reference, PathError is
Change it's The other change is is outright removing the At that point a Of course this is a breaking change, but in the meantime what is broken is not |
The point still remains. The or the comparison function ignores the frames is a red flag to me - want a reflect based method comparing two types that distinguishes based on the type of a field? That is 'reflection magic' and imho is a symptom of a flawed design. Is there anywhere else in the standard library where such approach is taken? Also, you focus on frames but maybe, down the line, some other similar property wants to be added. Then you have to add more reflection magic. In this proposal there is nothing special about |
This is a proposal for adding error wrapping to go.
It is a counter-proposal to Go2 error values (the original proposal).
Please share feedback, opinions etc in this issue.
Find the proposal details in https://github.com/JavierZunzunegui/xerrors.
At a high level, compared to the original proposal, this one:
Unwrap() error
or equivalent)There was a first iteration
of the ideas behind this proposal, but that is now to be regarded as obsolete.
The text was updated successfully, but these errors were encountered: