Re: [whatwg/fetch] Add abort reason to abort fetch (PR #1343)

> > What happens if the signal enters a service worker? We'd have to serialize/deserialize the reason, right?
> 
> That seems ideal, and kind of nice as a developer communication channel. But, the plumbing might get pretty complicated, and it might not be worth the extra spec/implementation/test work. The alternative is just saying that cross-realm aborting is special and we censor any abort reasons to "`AbortError`" `DOMException`s.

What we do for transferring abort reasons in streams is that we try to serialise them, but if the platform doesn't know how to serialise it we end up with an empty object. Since ECMAScript knows how to serialise Error types this works reasonably well for streams. But somehow it seems worse to end up with an empty object as an abort reason in fetch. So I have a preference for censoring it to an `AbortError` on transfer in fetch. I don't know what that would look like in standards language.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/pull/1343#issuecomment-955972120

Received on Monday, 1 November 2021 06:37:05 UTC