feat: capture HTTP Retry-After header in Error::retry_delay() (#21) #22

Merged
andreban merged 2 commits from feat/retry-after-header into main 2026-10-28 19:55:32 +00:00

2 Commits

Author SHA1 Message Date
440b3c7a87 fix: keep Retry-After for JSON error bodies and tighten parsing (#21)
All checks were successful
Rust / check (pull_request) Successful in 3m9s
- VertexApiError gains a serde-skipped retry_after field, filled from the
  Retry-After header. VertexApiError::retry_delay() prefers RetryInfo and
  falls back to it, so a JSON 429 without RetryInfo still exposes the
  header delay.
- parse_retry_after rejects anything but ASCII digits; u64::from_str
  alone accepted a leading '+'.
- Client tests share mock_client/http_response helpers instead of
  repeating the mock server setup in every test.
2026-10-28 19:49:45 +00:00
2e0016eb25 feat: capture HTTP Retry-After header in Error::retry_delay() (#21)
All checks were successful
Rust / check (pull_request) Successful in 2m41s
Error::HttpStatus gains a retry_after field, filled from the response's
Retry-After header (delay-seconds form) before the body is consumed.
Error::retry_delay() now returns it for HttpStatus errors, so a 429 or
503 with a non-Vertex body still exposes the server's retry hint.

Closes #21
2026-10-28 08:54:52 +00:00