Strategies for classifying and handling carrier API errors.
Classify carrier errors into three categories:
1. Retryable: 429, 502, 503, 504, timeouts — queue for retry with backoff
2. Permanent: 400, 401, 403, 404, 422 — fail fast, alert, don't retry
3. Ambiguous: 500, timeout on POST — investigate before retry
At the integration boundary, map all carrier errors to your internal format (e.g., Problem Details). Log the full request and response for debugging. Never expose raw carrier errors to end users.