Re: [whatwg/dom] Add a way to identify Abort errors originating from controllers (Issue #1033)

Just to point out another example, accepting an `AbortSignal` that can signal any error is not significantly different from accepting a function that can throw an arbitrary error. In either case if you don't know where the signal/function is coming from, then you can't reasonably expect to handle any error it could throw.

i.e. Like this could throw any error:

```js
async function someTask(transformResult=(result) => result) {
    const data = await loadDataSomehow();
    const transformed = await transformResult(data);
    return transformed;
}
```

If you're not in control of the `transformResult` function, then you can't really expect to be able to distinguish errors thrown from `transformResult` vs from within `loadDataSomehow`. In this way `AbortSignal` works the same, if you don't have the signal/controller you can't do anything to control how it behaves, or even know which behaviour is used.

-- 
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/dom/issues/1033#issuecomment-976156684

Received on Tuesday, 23 November 2021 04:18:30 UTC