feat: include called service URI in StatusRuntimeException descriptions#772
Open
He-Pin wants to merge 2 commits into
Open
feat: include called service URI in StatusRuntimeException descriptions#772He-Pin wants to merge 2 commits into
He-Pin wants to merge 2 commits into
Conversation
Motivation: When a gRPC call fails, the StatusRuntimeException description does not indicate which service/method was being called, making debugging harder in environments with multiple services. Modification: Add requestUri parameter to responseToSource, parseResponseStatus, and mapToStatusException. Use augmentDescription to append the request URI to all error descriptions. Update existing tests and add a dedicated test for URI inclusion. Result: StatusRuntimeException messages now include the full request URI (e.g. "When calling rpc service: https://host/Service/Method"), improving debuggability of gRPC failures. Tests: sbt "runtime / Test / testOnly org.apache.pekko.grpc.internal.PekkoHttpClientUtilsSpec" — 4/4 passed References: Refs akka/akka-grpc#1748
…tions Motivation: The status_code_and_message interop test checks exact equality of StatusRuntimeException descriptions, which now include augmented request URI info. Modification: Use startsWith instead of exact equality for description assertions in both Scala and Java interop client testers. Apply scalafmt. Result: Interop tests pass with the new augmented error descriptions. Tests: sbt "interop-tests / Test / testOnly org.apache.pekko.grpc.interop.GrpcInteropPekkoJavaWithPekkoHttpJavaSpec" — 10/10 passed References: Refs akka/akka-grpc#1748
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
When a gRPC call fails, the
StatusRuntimeExceptiondescription does not indicate which service/method was being called. This makes debugging harder in environments with multiple gRPC services, as the error message alone doesn't reveal the target endpoint.Modification
requestUri: Uriparameter toresponseToSource,parseResponseStatus, andmapToStatusExceptioninPekkoHttpClientUtilsaugmentDescriptionto append"When calling rpc service: <URI>"to all error status descriptionsResult
StatusRuntimeExceptionmessages now include the full request URI (e.g."When calling rpc service: https://host/com.example.MyService/DoSomething"), improving debuggability of gRPC failures.Tests
sbt "runtime / Test / testOnly org.apache.pekko.grpc.internal.PekkoHttpClientUtilsSpec"— 4/4 passedReferences
Refs akka/akka-grpc#1748