Skip to content

Misc error reporting improvements#475

Merged
Luap99 merged 7 commits intocoreos:mainfrom
kolyshkin:error
Sep 18, 2025
Merged

Misc error reporting improvements#475
Luap99 merged 7 commits intocoreos:mainfrom
kolyshkin:error

Conversation

@kolyshkin
Copy link
Collaborator

Please see individual commits for details.

Instead of adding a string representation of errno to an error message,
wrap the actual errno using %w.

Signed-off-by: Kir Kolyshkin <[email protected]>
The error from os.Readfile already contains file name and operation that
failed, there is no need to wrap it.

Signed-off-by: Kir Kolyshkin <[email protected]>
Error messages returned by GetHandle and GetSymbolPointer are already
descriptive enough so they don't need to be wrapped.

Signed-off-by: Kir Kolyshkin <[email protected]>
Using errors.New to make an error and then using %v to call its Error
method to add a string to the message seems unnecessary.

Simplify it by using the string as is.

Signed-off-by: Kir Kolyshkin <[email protected]>
It makes little sense to have very detailed error messages saying which
response field we failed to typecast. Let's use more generic "failed to
parse response" error message, and show what we tried to parse.

Signed-off-by: Kir Kolyshkin <[email protected]>
...if there are no %-style arguments.

Signed-off-by: Kir Kolyshkin <[email protected]>
Copy link
Collaborator

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

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

LGTM

@Luap99 Luap99 merged commit 68cc651 into coreos:main Sep 18, 2025
21 checks passed
@kolyshkin kolyshkin added this to the v22.7.0 milestone Jan 28, 2026
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