doc: add DOMException section to errors API reference#64236
Open
ChloeVPin wants to merge 3 commits into
Open
Conversation
Document the DOMException error class on the Errors page, cross-link to globals.md, and clarify how DOMException abort errors differ from Node.js AbortError used by Node-specific AbortSignal APIs. Fixes: nodejs#40789 Signed-off-by: ChloeVPin <227690662+ChloeVPin@users.noreply.github.com>
1 task
aduh95
reviewed
Jul 1, 2026
Signed-off-by: ChloeVPin <227690662+ChloeVPin@users.noreply.github.com>
aduh95
reviewed
Jul 1, 2026
Signed-off-by: ChloeVPin <227690662+ChloeVPin@users.noreply.github.com>
aduh95
reviewed
Jul 1, 2026
Comment on lines
+418
to
+424
| Node.js-specific APIs that support {AbortSignal} (such as | ||
| [`events.once()`][]) throw a Node.js `AbortError` (a native {errors.Error} with | ||
| `name` of `'AbortError'` and `code` of `'ABORT_ERR'`) rather than a | ||
| `DOMException`. To identify abort errors in either case, checking | ||
| `err?.name === 'AbortError'` is sufficient. | ||
|
|
||
| See also [`ABORT_ERR`][]. |
Contributor
There was a problem hiding this comment.
Suggested change
| Node.js-specific APIs that support {AbortSignal} (such as | |
| [`events.once()`][]) throw a Node.js `AbortError` (a native {errors.Error} with | |
| `name` of `'AbortError'` and `code` of `'ABORT_ERR'`) rather than a | |
| `DOMException`. To identify abort errors in either case, checking | |
| `err?.name === 'AbortError'` is sufficient. | |
| See also [`ABORT_ERR`][]. | |
| Node.js-specific APIs that support {AbortSignal} (such as | |
| [`events.once()`][]) throw a Node.js `AbortError` (a native {errors.Error} with | |
| `name` of `'AbortError'` and `code` of [`'ABORT_ERR'`][]) rather than a | |
| {DOMException}. To identify abort errors in either case, checking | |
| `err?.name === 'AbortError'` is sufficient. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #40789
Adds a
## Class: DOMExceptionsection todoc/api/errors.md, following thesame cross-link pattern used for
AssertionError(summary on the Errors page,details on the globals page).
The section documents:
DOMExceptiondomException.codevalues (for example20forABORT_ERR) versusstring
error.codevalues used by most Node.js errorsDOMExceptionabort errors from web-platform APIs(
fetch(),AbortSignal.throwIfAborted(), and similar) and Node.jsAbortError(codeof'ABORT_ERR') thrown by Node-specific APIs such asevents.once()err?.name === 'AbortError'works for identifying abort errors in bothcases
Verified locally with
node tools/lint-md/lint-md.mjs doc/api/errors.md.