-
Notifications
You must be signed in to change notification settings - Fork 216
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: remove empty error wrapping #1185
fix: remove empty error wrapping #1185
Conversation
That's not how https://github.com/pkg/errors/blob/614d223910a179a466c1767a985424175c39b465/errors.go#L181-L196
|
I'm sorry that my own misunderstanding memed this into existence, but honestly the proposed changes read better in my eyes, even if the two are isomorphic. Nothing magical is happening and the error path is neatly separated from the happy path. |
I agree, but if we observed non-nil, empty errors and thought that this was the cause - it's not. This isn't the fix and the bug is elsewhere. |
Co-authored-by: Evan Baker <[email protected]> Signed-off-by: Ritwik Ranjan <[email protected]>
# Description This pull request includes changes to improve error handling in the `pkg/plugin/hnsstats/vfp_counters_windows.go` file. The most important changes include modifying the `getVfpPortCountersRaw` and `listvPorts` functions to ensure they return appropriate error messages when command execution fails. Error handling improvements: * [`pkg/plugin/hnsstats/vfp_counters_windows.go`](diffhunk://#diff-0999dc1285d058391926e8093f7a02cea33a0e2d3cd1ba29bfd1b153900d23c2L156-R170): Modified the `getVfpPortCountersRaw` function to return an empty string and wrapped error message when command execution fails. * [`pkg/plugin/hnsstats/vfp_counters_windows.go`](diffhunk://#diff-0999dc1285d058391926e8093f7a02cea33a0e2d3cd1ba29bfd1b153900d23c2L156-R170): Modified the `listvPorts` function to return the command output and wrapped error message when command execution fails. ## Checklist - [X] I have read the [contributing documentation](https://retina.sh/docs/contributing). - [X] I signed and signed-off the commits (`git commit -S -s ...`). See [this documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification) on signing commits. - [X] I have correctly attributed the author(s) of the code. - [ ] I have tested the changes locally. - [X] I have followed the project's style guidelines. - [X] I have updated the documentation, if necessary. - [X] I have added tests, if applicable. ## Screenshots (if applicable) or Testing Completed Please add any relevant screenshots or GIFs to showcase the changes made. ## Additional Notes Add any additional notes or context about the pull request here. --- Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more information on how to contribute to this project. --------- Signed-off-by: Ritwik Ranjan <[email protected]> Co-authored-by: Evan Baker <[email protected]>
Description
This pull request includes changes to improve error handling in the
pkg/plugin/hnsstats/vfp_counters_windows.go
file. The most important changes include modifying thegetVfpPortCountersRaw
andlistvPorts
functions to ensure they return appropriate error messages when command execution fails.Error handling improvements:
pkg/plugin/hnsstats/vfp_counters_windows.go
: Modified thegetVfpPortCountersRaw
function to return an empty string and wrapped error message when command execution fails.pkg/plugin/hnsstats/vfp_counters_windows.go
: Modified thelistvPorts
function to return the command output and wrapped error message when command execution fails.Checklist
git commit -S -s ...
). See this documentation on signing commits.Screenshots (if applicable) or Testing Completed
Please add any relevant screenshots or GIFs to showcase the changes made.
Additional Notes
Add any additional notes or context about the pull request here.
Please refer to the CONTRIBUTING.md file for more information on how to contribute to this project.