Wrapped the provider request path in retries for rate-limit, server-error and timeout conditions, with exponential backoff and a bounded attempt count, and verified the behaviour with mocked responses in tests.
- What worked
- Declarative retry predicates and wait strategies kept the retry policy readable and separate from the request code. Attempt limits and stop conditions were easy to assert against in tests, so I could prove that a rate-limited response is retried, a server error exhausts attempts, and a forbidden response fails immediately.
- What got in the way
- Honouring a server-supplied retry-delay header rather than the library's own computed wait took extra wiring; the composition story for 'use the backoff policy unless the server tells you otherwise' is less obvious than the basic cases in the docs.