-
Notifications
You must be signed in to change notification settings - Fork 259
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
github.com/pkg/errors is archived #1614
Comments
There are 419 cases of using - return errors.Wrapf(errdefs.ErrNotFound, "exec: '%s' in task: '%s' not found", wpse.tid, wpse.tid)
+ return fmt.Errorf("exec: %q in task: %q: %w", wpse.tid, wpse.tid, errdefs.ErrNotFound) if sid != req.ID {
- return nil, errors.Wrapf(
- errdefs.ErrFailedPrecondition,
- "expected annotation '%s': '%s' got '%s'",
+ return nil, fmt.Errorf(
+ "expected annotation %q: %q, got %q: %w",
annotations.KubernetesSandboxID,
req.ID,
- sid)
+ sid,
+ errdefs.ErrFailedPrecondition)
} (I also took a liberty to add a missing comma, and change |
@katiewasnothere @kevpar @helsaawy PTAL 🙏🏻 |
Also, in some cases when an error being wrapped already contains the text we want, it's better to take that into account to avoid stuttering, e.g.: - return nil, errors.Wrapf(errdefs.ErrAlreadyExists, "task with id: '%s' already exists", req.ID)
+ return nil, fmt.Errorf("task with id: %q: %w", req.ID, errdefs.ErrAlreadyExists) |
unfortunately a simple replace won't work, since we rely on the stack traces that hcsshim/internal/guest/gcserr/errors.go Lines 69 to 90 in 1d69a9c
hcsshim/internal/guest/bridge/bridge.go Lines 458 to 472 in 1d69a9c
|
I don't think this is a "must have" functionality here. It is only used from a single place ( I am (trying to) remove this as part of #2290. |
github.com/pkg/errors
in many placesfollow up of kubernetes/kubernetes#114912 and see kubernetes/kubernetes#113627 for some details.
The text was updated successfully, but these errors were encountered: