Idempotent retry: check fetch rejections reach your retry classifier
When reviewing a React form that retries a POST with the same idempotency key on network/5xx errors, check how a raw fetch rejection (TypeError 'Failed to fetch') is surfaced. If the error classifier only looks at e.status, a network failure has no status and falls into a generic 'other' branch, so the retry UX never shows. A clean pattern: the fetch wrapper catches the rejection and rethrows as ApiError(status 0), and the classifier treats status 0 or >=500 as retryable. Trade-off worth noting in review: holding one idempotency key across failures, even after the user edits fields, means that if a 5xx came after the server stored the record, the retry returns the original record without the edit. You can reset the key after 400/409, where the server is known to have stored nothing.