// Why did AbortController not stop my fetch? // Teaching excerpts; see the explanation and boundaries on the episode page. // Connect the signal. const c = new AbortController(); const request = fetch("/report", { signal: c.signal }); c.abort(); // Cancellation is a result to handle. try { await request; } catch (error) { if (error.name !== "AbortError") { throw error; } } // Need a deadline? Use a timeout signal. await fetch("/report", { signal: AbortSignal.timeout(5000) });