We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Reference: microsoft/go-winio#187 (comment)
In a unit test, I had code that checked an API call failure to detect missing privilege:
if errno, ok := errors.Cause(err).(syscall.Errno); ok && errno == syscall.ERROR_PRIVILEGE_NOT_HELD {
however, adapting it to use computestorage.FormatWritableLayerVhd, that no longer works, and I must use
computestorage.FormatWritableLayerVhd
if strings.Contains(err.Error(), "A required privilege is not held by the client.") {
This is because of the use of fmt.Errorf('...%s', err). If this is changed to errors.Wrapf(err, '...'), then I'd get the result I wanted.
fmt.Errorf('...%s', err)
errors.Wrapf(err, '...')
I guess this was an oversight, since computerstorage/helpers.go does use errors.Wrapf and errors.Wrap.
errors.Wrapf
errors.Wrap
However, I don't want to just put up a PR without discussion, if this was deliberately done to hide/obscure the underlying failure in these APIs.
The text was updated successfully, but these errors were encountered:
@TBBle Was an oversight, I can send a change for this. Thanks!
Sorry, something went wrong.
Wrap errors from computestorage package
f69cfc4
* Change from stringifying errors with fmt.Errorf to errors.Wrap everywhere Fixes: microsoft#924 Signed-off-by: Daniel Canter <dcanter@microsoft.com>
Successfully merging a pull request may close this issue.
Reference: microsoft/go-winio#187 (comment)
In a unit test, I had code that checked an API call failure to detect missing privilege:
however, adapting it to use
computestorage.FormatWritableLayerVhd
, that no longer works, and I must useThis is because of the use of
fmt.Errorf('...%s', err)
. If this is changed toerrors.Wrapf(err, '...')
, then I'd get the result I wanted.I guess this was an oversight, since computerstorage/helpers.go does use
errors.Wrapf
anderrors.Wrap
.However, I don't want to just put up a PR without discussion, if this was deliberately done to hide/obscure the underlying failure in these APIs.
The text was updated successfully, but these errors were encountered: