Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates HttpJsonErrorParser to filter out unrecognized or malformed error details from the JSON payload before parsing it into a Status object, ensuring only recognized standard error types are processed. It also adds unit tests to verify this behavior. Feedback was provided to replace JsonArray.asList() with JsonArray.iterator() to maintain backward compatibility with older Gson versions and prevent potential NoSuchMethodError runtime exceptions.
whowes
force-pushed
the
whowes/preserve-proto-errors
branch
2 times, most recently
from
October 9, 2026 17:33
ce6bbb6 to
dc192fc
Compare
whowes
force-pushed
the
whowes/preserve-proto-errors
branch
from
October 12, 2026 18:27
dc192fc to
c60c8c1
Compare
whowes
marked this pull request as ready for review
October 12, 2026 18:36
|
|
This branch has not been deployed
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.





Currently HTTP/JSON error responses that include unrecognized protos (e.g. service specific, including non-GCP) in
error.detailsfail withInvalidProtocolBufferExceptionduring proto conversion. This results in the user receiving an emptyStatusand losing the top-level error message and any recognizedgoogle.rpc.*error details.To avoid this loss, this change filters
error.detailsbefore proto conversion so only entries with a@typeregistered inSTANDARD_ERROR_TYPESare passed toJsonFormat.Parser. The JSON from filtered-out details is still visible to the user in stack traces.