-
Notifications
You must be signed in to change notification settings - Fork 9
Fix GoogleRPCStatus encoding/decoding #58
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
Conversation
Motivation: The 'rich' error model packs a google.rpc.status protobuf message into the trailing metadata of an RPC. This should just be the base64 encoded bytes of the serialzed message. At the moment this is packed within a google.protobuf.any and then added to the metadata which doesn't interop well with other languages. Modifications: - Remove the indirection - Add methods for serializing/deserializing the RPC status wrapper Result: Better interop
/// fields. | ||
/// - partial: If `false` (the default), this method will check if the `Message` | ||
/// is initialized after decoding to verify that all required fields are present. | ||
/// If any are missing, this method throws `BinaryDecodingError`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we be making promises in the docs about the type of the error we're throwing? Can't we use typed throws instead, or omit it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. These are from the protobuf docs and we're really just wrapping the protobuf call so I think it's okay. We shouldn't use typed throws as that paints us into a corner (also, protobuf doesn't use it) if the error type does change.
…O Transport` to 1.0.3 ### What changes were proposed in this pull request? This PR aims to upgrade `gRPC Swift Protobuf` to 1.2.0 and `gRPC Swift NIO Transport` to 1.0.3. ### Why are the changes needed? To bring the latest bug fixes. - https://github.com/grpc/grpc-swift-protobuf/releases/tag/1.2.0 - grpc/grpc-swift-protobuf#58 - https://github.com/grpc/grpc-swift-nio-transport/releases/tag/1.0.3 ### Does this PR introduce _any_ user-facing change? No, there is no behavior change. ### How was this patch tested? Pass the CIs. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #71 from dongjoon-hyun/SPARK-51846. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
Motivation:
The 'rich' error model packs a google.rpc.status protobuf message into the trailing metadata of an RPC. This should just be the base64 encoded bytes of the serialzed message. At the moment this is packed within a google.protobuf.any and then added to the metadata which doesn't interop well with other languages.
Modifications:
Result:
Better interop