Skip to content
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

Add a resolve error function to return first error #9

Merged
merged 1 commit into from
Jun 21, 2024

Conversation

dmcgowan
Copy link
Member

When an error object is returned and must be resolved to a single return error, the first error matching one defined by this package should be returned.

This is needed to accurately resolve a grpc when an error is wrapped. For example if wrapping a NotFound error with ErrInvalidArgument, then ErrInvalidArgument should be used to resolve the status code. The ordering of the error chain should have precedence over the ordering of the Is* checks.

resolve.go Show resolved Hide resolved
When an error object is returned and must be resolved to a single return
error, the first error matching one defined by this package should be
returned.

Signed-off-by: Derek McGowan <[email protected]>
@dmcgowan
Copy link
Member Author

Updated

Copy link
Member

@henry118 henry118 left a comment

Choose a reason for hiding this comment

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

LGTM :)

Copy link
Member

@dims dims left a comment

Choose a reason for hiding this comment

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

LGTM

@dmcgowan dmcgowan merged commit 6c7f402 into containerd:main Jun 21, 2024
7 checks passed
@dmcgowan dmcgowan deleted the resolve-error branch June 21, 2024 22:56
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.

4 participants