Re: [w3c/ServiceWorker] clarify behaviour of `AbortSignal` in `FetchEvent::respondWith` (Issue #1662)

annevk left a comment (w3c/ServiceWorker#1662)

Thanks @yoshisatoyanagisawa, you're right of course.

I'm not sure we want to change `respondWith()` as it seems possible people are relying on exceptions in `Response`-creation to result in network errors (i.e., `TypeError` to `fetch()`). As that's the current contract.

I could see exposing an API that would pass through any "reason" though. As long as it can be structured cloned. Perhaps `respondWithAny()`. If it's not a `Response` the fetch side will reject with whatever was passed in or a "`DataCloneError`" `DOMException` if it could not be cloned.

---

For the separate suggestion as to whether `Response` should take an `AbortSignal`. I don't think so, you should be able to use a stream for that already.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/issues/1662#issuecomment-3758885569
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/ServiceWorker/issues/1662/3758885569@github.com>

Received on Friday, 16 January 2026 09:10:12 UTC