Skip to content

feat: include called service URI in StatusRuntimeException descriptions#772

Open
He-Pin wants to merge 2 commits into
mainfrom
feat/service-info-in-status-exception
Open

feat: include called service URI in StatusRuntimeException descriptions#772
He-Pin wants to merge 2 commits into
mainfrom
feat/service-info-in-status-exception

Conversation

@He-Pin

@He-Pin He-Pin commented Jul 2, 2026

Copy link
Copy Markdown
Member

Motivation

When a gRPC call fails, the StatusRuntimeException description 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

  • Add requestUri: Uri parameter to responseToSource, parseResponseStatus, and mapToStatusException in PekkoHttpClientUtils
  • Use augmentDescription to append "When calling rpc service: <URI>" to all error status descriptions
  • Update existing tests to verify the URI is included in descriptions
  • Add a dedicated test case for URI inclusion in HTTP error responses

Result

StatusRuntimeException messages 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 passed

References

Refs akka/akka-grpc#1748

He-Pin added 2 commits July 3, 2026 04:04
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant