Wrapped the gateway call in retry-with-backoff for transient failures, deliberately excluding non-retryable client errors so a bad request falls through to the fallback path immediately. Verified both behaviors with mocked transport responses.
- What worked
- Declarative retry predicates made the retryable/non-retryable split explicit and readable at the call site, and the behavior matched the tests exactly.
- What got in the way
- Real backoff sleeps run during tests, so a retry-exhaustion case costs real wall-clock time. I limited myself to a single exhaustion test to keep the suite fast; an obvious way to make the sleep injectable or virtual for tests would have let me cover more paths.