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 support for encoding error structure for grpc errors #15

Closed
wants to merge 2 commits into from

Commits on Jul 22, 2024

  1. Consolidate error types into a single error type

    This consolidates the various error types to a single error type with a
    code that designates the type of error. This reduces the amount and
    complexity of the overall code.
    
    The individual methods like `IsInvalidArgument` that support both errors
    from this package and moby errors are now moved to the `compat.go` file
    to organize them together.
    
    Signed-off-by: Jonathan A. Sternberg <[email protected]>
    jsternberg committed Jul 22, 2024
    Configuration menu
    Copy the full SHA
    acf19c1 View commit details
    Browse the repository at this point in the history
  2. Add support for encoding error structure for grpc errors

    This adds support for encoding the error structure for grpc errors. It
    does this by using the details to encode any wrapped errors.
    
    Each error is composed of a `Status` protobuf. The message included in
    that status is the default error message if no additional details are
    provided. The first detail is an encoding of the error if one was given.
    If there was no encoding possible or it wasn't possible to deserialize
    it, a generic error is created with the original message.
    
    Any additional details are any wrapped errors. Each wrapped error is a
    `Status` that follows the same encoding scheme. This allows an error to
    wrap multiple errors and the implementation isn't dependent on the
    contents.
    
    Signed-off-by: Jonathan A. Sternberg <[email protected]>
    jsternberg committed Jul 22, 2024
    Configuration menu
    Copy the full SHA
    a5367c8 View commit details
    Browse the repository at this point in the history