Skip to content

Add a resolve error function to return first error#9

Merged
dmcgowan merged 1 commit intocontainerd:mainfrom
dmcgowan:resolve-error
Jun 21, 2024
Merged

Add a resolve error function to return first error#9
dmcgowan merged 1 commit intocontainerd:mainfrom
dmcgowan:resolve-error

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.

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