-
Notifications
You must be signed in to change notification settings - Fork 385
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(rest): return complete payloads for errors #10051
fix(rest): return complete payloads for errors #10051
Conversation
Google Cloud Build Logs
ℹ️ NOTE: Kokoro logs are linked from "Details" below. |
Codecov ReportBase: 94.23% // Head: 94.22% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #10051 +/- ##
==========================================
- Coverage 94.23% 94.22% -0.01%
==========================================
Files 1527 1527
Lines 141847 141822 -25
==========================================
- Hits 133669 133632 -37
- Misses 8178 8190 +12
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
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.
Reviewed 8 of 8 files at r1, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @coryan)
We need the full payload when returning completing a `HttpRequest` with a non-OK status code. The payload may contain a full ErrorInfo, and we want the application to have access to those. `rest_internal::CurlImpl` was converting the HTTP status code unless it was in a list of values ignored. Then `storage::RestClient` used a per-method predicate to convert some values to errors. It seems simpler to *never* convert an HTTP status code to a `Status` in the `CurlImpl` layer. After all, an HTTP request that completes with a status code was able to send and receive the call.
63e346a
to
8ace31e
Compare
Google Cloud Build Logs
ℹ️ NOTE: Kokoro logs are linked from "Details" below. |
We need the full payload when returning completing a
HttpRequest
with a non-OK status code. The payload may contain a full ErrorInfo, and we want the application to have access to those.rest_internal::CurlImpl
was converting the HTTP status code unless it was in a list of values ignored. Thenstorage::RestClient
used a per-method predicate to convert some values to errors. It seems simpler to never convert an HTTP status code to aStatus
in theCurlImpl
layer. After all, an HTTP request that completes with a status code was able to send and receive the call.Fixes #9947
This change is