Add support for grpc error details and multiple errors#7
Merged
AkihiroSuda merged 2 commits intocontainerd:mainfrom Aug 16, 2024
Merged
Add support for grpc error details and multiple errors#7AkihiroSuda merged 2 commits intocontainerd:mainfrom
AkihiroSuda merged 2 commits intocontainerd:mainfrom
Conversation
stevvooe
reviewed
Jun 7, 2024
stevvooe
reviewed
Jun 7, 2024
2fd184b to
b5a9ec0
Compare
Member
Author
|
Updated and now handles a case where multi-errors get wrapped |
Member
Author
|
Marking this back to draft, #9 should be considered first. We should also consider in the multi-error case using the collapsible errors introduced in the stacks PR. |
57fa4b4 to
5596f37
Compare
Member
Author
|
Updated, this is ready to review again. Included better support for custom error types in the details similar to https://github.com/moby/buildkit/blob/master/util/grpcerrors/grpcerrors.go |
The Is interface may be used to resolve if no other unwrap interface is implemented. This interface is safe to use in this situation, unlike errors.Is, since the error should not be unwrapped further. Signed-off-by: Derek McGowan <[email protected]>
5596f37 to
13de52f
Compare
Member
Author
|
Updated for better resolution of primary error cause and handling of error details. |
Member
|
@stevvooe LGTY? |
AkihiroSuda
reviewed
Aug 14, 2024
errgrpc/grpc.go
Outdated
| if isGRPC { | ||
| desc = s.Message() | ||
| code = s.Code() | ||
|
|
AkihiroSuda
approved these changes
Aug 14, 2024
When multiple errors are given, use details to encode errors into the grpc status and decode details back into errors. Signed-off-by: Derek McGowan <[email protected]>
13de52f to
b9dce4d
Compare
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.
When multiple errors are given, use details to encode errors into the grpc status and decode details back into errors.
This allows supporting multiple errdefs as well as any error type which can be marshaled with proto or registered with typeurl.