chore: migration trace - rich error model client API#654
Closed
He-Pin wants to merge 1 commit intoapache:mainfrom
Closed
chore: migration trace - rich error model client API#654He-Pin wants to merge 1 commit intoapache:mainfrom
He-Pin wants to merge 1 commit intoapache:mainfrom
Conversation
This commit marks the migration of akka/akka-grpc commits 1c08d131 and 40fb2f2c into pekko-grpc. The feature was independently ported to apache/pekko-grpc as PR apache#645 (commit 8230003). Local migration commit: 7fe45e6b Upstream: akka/akka-grpc@1c08d131 akka/akka-grpc@40fb2f2c Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
Author
Investigation: Why this PR has no file changesAfter investigation, this PR contains zero file changes because the Rich Error Model client API feature was already independently merged into apache/pekko-grpc as PR #645 (commit Our migration commit Closing this PR as the feature is already available in |
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.
Motivation
This PR tracks the migration of upstream akka/akka-grpc commits
1c08d131and40fb2f2cwhich together add first-class client-side support for the gRPC Rich Error Model.Previously, when a gRPC call failed with a
StatusRuntimeExceptioncontaining rich error details (as defined by Google's API Design Guide error model), there was no first-class API to access the structuredcom.google.rpc.Statusfrom the client side. Users had to manually inspect trailers using grpc-java internals.Modification
scaladsl.MetadataStatustrait withstatus,code,message,details,getParsedDetails[K]methodsjavadsl.MetadataStatustrait with Java-style getter methodsRichGrpcMetadataImpl(internal) that extractscom.google.rpc.StatusfromStatusRuntimeExceptiontrailers viaStatusProto.fromStatusAndTrailersGrpcServiceException.apply(StatusRuntimeException)to wrap metadata inRichGrpcMetadataImplGrpcServiceException.create()Java API acceptingjava.util.List.recoverWith(richError)/.recoverWithRetries(1, richErrorStream)to allRequestBuilderImplinvocation pathsRichErrorModelNativeSpec.scalaandRichErrorModelNativeTest.javaintegration testsRichErrorModelSpecrefactored from abstract to concreteResult
Clients can pattern-match
GrpcServiceException.metadataasMetadataStatusand callgetParsedDetails[LocalizedMessage](or similar) to access structured error details without touching grpc-java internals.References
7fe45e6b