-
Notifications
You must be signed in to change notification settings - Fork 313
Closed
Labels
addition/proposalNew features or enhancementsNew features or enhancementsneeds implementer interestMoving the issue forward requires implementers to express interestMoving the issue forward requires implementers to express interesttopic: abortingAbortController and AbortSignalAbortController and AbortSignal
Description
Bit of a half baked idea, but should we make it easier to throw abort errors from signals? Something like:
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?
benjamingr, vkrol, mikuso, bathos, yjaaidi and 2 more
Metadata
Metadata
Assignees
Labels
addition/proposalNew features or enhancementsNew features or enhancementsneeds implementer interestMoving the issue forward requires implementers to express interestMoving the issue forward requires implementers to express interesttopic: abortingAbortController and AbortSignalAbortController and AbortSignal