get
fetch, retried once when a pooled keep-alive connection is reset: the server may close an idle socket just as it is reused, which happens when a loaded machine stretches the gaps between requests. Browsers retry these too.
export async function get(url: string | URL, init?: RequestInit): Promise<Response> { try { return await fetch(url, init); } catch (e) { if ((e as { cause?: { code?: string } }).cause?.code !== "ECONNRESET") throw e; return fetch(url, init); } }