Skip to content

fix(http): preserve unexpected response context#558

Merged
huacnlee merged 1 commit into
mainfrom
fix/preserve-http-error-response
Jul 21, 2026
Merged

fix(http): preserve unexpected response context#558
huacnlee merged 1 commit into
mainfrom
fix/preserve-http-error-response

Conversation

@huacnlee

Copy link
Copy Markdown
Member

Summary

  • preserve the HTTP status, x-trace-id, complete response headers, and raw body when a response cannot be parsed as the standard OpenAPI envelope
  • expose the preserved context through a new UnexpectedHttpResponse error variant while retaining the existing BadStatus variant for compatibility
  • keep rich 429 responses retryable and return the final original response when retries are exhausted
  • document the behavior change in the changelog

This makes intermediary and load-balancer failures diagnosable instead of reducing responses such as HTTP 463 to status error: 463 <unknown status code>.

Test Plan

  • cargo +nightly fmt --all
  • cargo test -p longbridge-httpcli
  • cargo clippy --all --all-features
  • git diff --check

The full workspace Clippy run completes successfully; its warnings are pre-existing in current main and unrelated to this change.

Co-authored-by: Codex <codex@openai.com>
@huacnlee
huacnlee merged commit 5462123 into main Jul 21, 2026
56 checks passed
@huacnlee
huacnlee deleted the fix/preserve-http-error-response branch July 21, 2026 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant