Repository navigation
Conversation
There was a problem hiding this comment.
Code Review
This pull request improves error handling in src/gax-internal/src/prost.rs by replacing a panic (expect) with proper error propagation (?) when converting non-finite floats (NaN or infinite) to JSON numbers. It also adds comprehensive unit tests to verify correct behavior for both finite and non-finite numbers across values, structs, and lists. I have no additional feedback to provide as the changes are robust and align with the repository's style guide regarding error handling.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7427 +/- ##
==========================================
- Coverage 98.65% 98.65% -0.01%
==========================================
Files 334 334
Lines 145620 145673 +53
==========================================
+ Hits 143657 143707 +50
- Misses 1963 1966 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Converting incoming protobuf numeric values into JSON values previously panicked when encountering a non-finite number, such as NaN or infinity. While protobuf wire formats allow non-finite floating-point numbers, standard JSON numeric representations only permit finite values. Instead of panicking when an unrepresentable number arrives over the wire, return a conversion error so calling services and background tasks can safely catch, log, or ignore the invalid payload.
8fc76e0 to
aeac845
Compare
Converting incoming protobuf numeric values into JSON values previously panicked when encountering a non-finite number, such as NaN or infinity. While protobuf wire formats allow non-finite floating-point numbers, standard JSON numeric representations only permit finite values.
Instead of panicking when an unrepresentable number arrives over the wire, return a conversion error so calling services and background tasks can safely catch, log, or ignore the invalid payload.