New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix GrpcStatus for InvalidProtocolBufferException #5554
Fix GrpcStatus for InvalidProtocolBufferException #5554
Conversation
void invalidProtocolBufferExceptionToInvalidArgumentCode() { | ||
assertThat(GrpcStatus.fromThrowable(new InvalidProtocolBufferException("Failed to parse message")).getCode()) | ||
.isEqualTo(Status.Code.INVALID_ARGUMENT); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we also add an integration test that sends invalid data described in the issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I'll
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5554 +/- ##
============================================
- Coverage 74.11% 74.09% -0.02%
+ Complexity 21013 20977 -36
============================================
Files 1819 1819
Lines 77397 77307 -90
Branches 9889 9877 -12
============================================
- Hits 57359 57278 -81
+ Misses 15380 15373 -7
+ Partials 4658 4656 -2 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the quick fix! 🚀🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 👍 👍
Motivation:
Modifications:
InvalidProtocolBufferException
) handling logic that returnsINVALID_ARGUMENT
to give more helpful description to clients.rpc EchoWrappers()
in transcoding.proto to accept http-post-binding in order to add integration test for type-mismatched json valueResult:
INVALID_ARGUMENT
instead ofUNAVAILABLE
for parsing exception when usingHttpJsonTranscoding
.