Retries an async operation with exponential backoff + jitter.
Async function to attempt.
Optional
Retry configuration.
The result of fn on success.
fn
WARNING: retry() is for infrastructure only — config loading, OTel init, bridge injection. Do NOT use for UI interactions — use Playwright's native auto-retry or waitForUI5Stable() instead.
retry()
waitForUI5Stable()
The last error after all retries are exhausted.
const result = await retry( () => fetchWithTimeout('/api/data'), { maxRetries: 3, baseDelay: 200, shouldRetry: (err) => err.message !== 'AUTH_FAILED' },); Copy
const result = await retry( () => fetchWithTimeout('/api/data'), { maxRetries: 3, baseDelay: 200, shouldRetry: (err) => err.message !== 'AUTH_FAILED' },);
Retries an async operation with exponential backoff + jitter.