Repository navigation
Conversation
Status.fromThrowable().asException() drops trailers, so a thrown StatusRuntimeException loses google.rpc.Status details when the handler returns null. onError already forwards them. Copy those trailers onto the fallback status. Fixes spring-projectsgh-444 Signed-off-by: WooSeung Kim <wooseung.dev@gmail.com>
beyondwin
force-pushed
the
fix-status-trailers
branch
from
November 6, 2026 00:19
b92e8b6 to
f06514f
Compare
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.
Throwing a StatusRuntimeException with trailers, such as google.rpc.Status details, drops those trailers when GrpcExceptionHandler returns null. onError with the same exception keeps them.
The fallback rebuilds the status with fromThrowable().asException(), which has no trailers. Handlers return null for exceptions they do not classify, and Spring Boot registers the interceptor even with no handler beans, so a thrown status usually takes this path.
Up to 0.8 the thrown trailers were sent (71355e6). The fixes for gh-193 and gh-332 switched to the handler result's trailers, and the fallback result has none. The fallback now copies trailersFromThrowable, as ServerCalls.onError does. A plain RuntimeException stays UNKNOWN with no description.
Fixes gh-444