-
Notifications
You must be signed in to change notification settings - Fork 160
cli: standardize error wrapping with %w (#3040) #3094
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
cli: standardize error wrapping with %w (#3040) #3094
Conversation
Signed-off-by: mohamedfawas <fawastmh@gmail.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3094 +/- ##
=======================================
Coverage ? 57.11%
=======================================
Files ? 341
Lines ? 33950
Branches ? 0
=======================================
Hits ? 19390
Misses ? 12951
Partials ? 1609 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
eleftherias
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @mohamedfawas, I noticed some %v remained. I left comments below.
Co-authored-by: Eleftheria Stein-Kousathana <eleftheria.kousathana@gmail.com>
|
I ran the failing test locally:
and it passes consistently on my end. Since this PR only changes error formatting and doesn’t touch workload/status logic, this looks like a CI-only or flaky failure. Happy to help investigate further or rerun CI if needed—please let me know how you’d like me to proceed. |
|
@mohamedfawas I was able to rerun the CI and the test passed. Thanks for your contribution! |
Summary
This PR standardizes error wrapping in the CLI by replacing
%vwith%wonly in cases where an existing
erroris being wrapped.This ensures proper error chaining and enables the use of
errors.Isanderrors.Asas intended by Go best practices.What was changed
fmt.Errorf(... %v, err)tofmt.Errorf(... %w, err)in CLI code pathsWhy this change
The CLI currently mixes
%vand%wfor error handling.Using
%wconsistently:Fixes #3040.
Testing