rework errors - #2362
Merged
Merged
rework errors#2362
Conversation
tkatila
approved these changes
Sep 24, 2026
tkatila
left a comment
Contributor
There was a problem hiding this comment.
lgtm, but there is a merge conflict with the main's go.mod
pkg/errors' Wrap/Wrapf return nil when the wrapped error is nil, which turned two checks into no-ops: - pkg/topology: the negative NUMA node check wrapped the (nil) parse error, so GetTopologyInfo accepted negative node IDs. Return a real error instead. - test/e2e/utils: TestWebhookServerTLS wrapped err (nil at that point) instead of waitErr, so a failed testssl.sh pod never failed the test. Assisted-by: Copilot:claude-fable-5.1 Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
pkg/errors has been unmaintained since Go 1.13 added native error
wrapping. Replace errors.Wrap/Wrapf with fmt.Errorf("...: %w"),
errors.WithStack(err) with a plain return, and errors.Errorf/New with
their fmt/errors counterparts. Error message text is preserved apart
from lowercasing the first letter (staticcheck ST1005).
Log sites using %+v no longer print stack traces. The wrapped context
chain carries the same information on a single line, and klog already
records the location of the log call.
Remove the err113 linter. Standard library fmt.Errorf triggers it
while pkg/errors.Errorf never did, and no code in the repository
inspects project-defined sentinel errors, so the checks would only add
boilerplate.
Update the error conventions in DEVEL.md accordingly.
Assisted-by: Copilot:claude-fable-5.1
Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
Contributor
Author
fixed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.