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

Won't it always be safer to check `signal.aborted` / `signal.reason` when handling rejection errors? Even if you brand the errors, it could have originated from a different signal.

```js
async function a({ signal }) {
  await b();
}

async function b() {
  const ab = new AbortController();
  ab.abort();
  throw ab.signal.reason;
}

try {
  const ab = new AbortController();
  await a({ signal: ab.signal });
}
catch (err) {
  console.log(err); // 'AbortError' DOMException
  console.log(ab.signal.aborted); // false
}
```

-- 
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-974801046

Received on Sunday, 21 November 2021 11:45:07 UTC