Skip to content

typescript.http_retry

Stability Medium

Detects HTTP calls without retry logic for transient failures.

Missing retry logic:

  • Single-point failures — One network blip breaks everything
  • Poor reliability — Transient errors not recovered
  • User frustration — Failed requests that would succeed on retry
// ❌ Before (no retry)
async function fetchData(): Promise<Data> {
return axios.get('/api/data').then(r => r.data);
}
// ✅ After (with retry logic)
import axiosRetry from 'axios-retry';
axiosRetry(axios, {
retries: 3,
retryDelay: axiosRetry.exponentialDelay,
retryCondition: (error) => {
return axiosRetry.isNetworkOrIdempotentRequestError(error)
|| error.response?.status === 429;
},
});
async function fetchData(): Promise<Data> {
return axios.get('/api/data').then(r => r.data);
}
  • HTTP clients without retry configuration
  • Missing exponential backoff
  • No retry condition logic

Unfault can add axios-retry or similar retry wrapper.