Skip to content

rework errors - #2362

Merged
tkatila merged 2 commits into
intel:mainfrom
mythi:PR-2026-010
Sep 24, 2026
Merged

tkatila merged 2 commits into
intel:mainfrom
mythi:PR-2026-010

Conversation

@mythi

@mythi mythi commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@mythi mythi mentioned this pull request Sep 24, 2026
4 tasks

@tkatila tkatila left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@mythi

mythi commented Sep 24, 2026

Copy link
Copy Markdown
Contributor Author

lgtm, but there is a merge conflict with the main's go.mod

fixed

@tkatila
tkatila merged commit 3e1a1c6 into intel:main Sep 24, 2026
64 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants