fix(api): dont 500 on cross dc response#4449
fix(api): dont 500 on cross dc response#4449MasterPtato wants to merge 1 commit into03-17-chore_update_byte_units_on_frontendfrom
Conversation
|
🚅 Deployed to the rivet-pr-4449 environment in rivet-frontend
|
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
PR Review:
|
29a5224 to
8ee527a
Compare
d4011f0 to
3b845cb
Compare
8ee527a to
5c55237
Compare
3b845cb to
1028b2c
Compare
|
PR Review: fix(api) dont 500 on cross dc response This is a small, focused bug fix that correctly addresses the issue of cross-DC responses being converted to 500 errors. Change Summary: In reqwest_to_axum_response, when a remote DC returned a non-2xx response, anyhow::bail!() was called, which propagated as an internal server error (500) instead of forwarding the actual response status and body to the client. The fix logs the error and allows the response to pass through with its original status code. Whats Good: reqwest_to_axum_response is intended as a raw pass-through so forwarding the original status code and body is the right approach. The new tracing::error! call correctly follows the project logging conventions. The body_bytes borrow via String::from_utf8_lossy is correctly scoped within the if block. Minor Suggestions: (1) Consider using %status (Display) instead of ?status (Debug) for the status code - Display outputs 404 Not Found while Debug adds extra formatting noise. (2) tracing::error! is reasonable but tracing::warn! might reduce log noise if 404s are expected in normal operation. (3) The checklist items in the PR description are unchecked - worth filling in for completeness. Overall this is a correct and minimal fix. LGTM. |
5c55237 to
876713f
Compare
1028b2c to
88d15c3
Compare
PR Review:
|
88d15c3 to
ede07de
Compare
876713f to
3bf4304
Compare

Fixes RVT-6105
Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context.
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
Checklist: