-
Notifications
You must be signed in to change notification settings - Fork 698
Unwrap doesn't return the base error #223
Comments
errors.Unwraps only unwraps errors wrapper with errors.Wrap, not fmt.Errorf |
Not sure to understand you here. |
Unwrap is just a wrapper around the stdlib errors package's Unwrap. |
As @davecheney said the behaviour of the |
Oh, this might be the source of the confusion: This ends up being misleading because one would naturally expect |
should use errors.Cause(err) |
There is no way in this scenario to retrieve |
Wrapping an error with
errors.Wrap
, unwrapping it witherrors.Unwrap
returns the whole error and not the base one. Is it intentional?https://play.golang.org/p/baYpfrrvN35
The text was updated successfully, but these errors were encountered: