[whatwg/dom] Encourage use of AbortError for cancellation? (#927)

Bit of a half baked idea, but should we make it easier to throw abort errors from signals? Something like:

```js
AbortSignal.prototype.assertNotAborted = function(message = 'Aborted') {
  if (this.aborted) throw new DOMException(message, 'AbortError');
}
```

I know it's a one-liner, but it might encourage using the right kind of error?

-- 
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/927

Received on Thursday, 19 November 2020 09:29:09 UTC