doc: list DOMException as a potential error raised by Node.js

PR-URL: https://github.com/nodejs/node/pull/57783
Refs: https://github.com/nodejs/node/pull/57735
Reviewed-By: Jordan Harband <ljharb@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jason Zhang <xzha4350@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
This commit is contained in:
Chengzhong Wu authored and RafaelGSS committed 2025-05-02 17:06:12 -03:00
1 parent 17965eb33d
commit a5ef2e8858
1 file changed
+11 -3
+11 -3
View File
@@ -4,23 +4,28 @@
<!--type=misc-->
Applications running in Node.js will generally experience four categories of
errors:
Applications running in Node.js will generally experience the following
categories of errors:
* Standard JavaScript errors such as {EvalError}, {SyntaxError}, {RangeError},
{ReferenceError}, {TypeError}, and {URIError}.
* Standard `DOMException`s.
* System errors triggered by underlying operating system constraints such
as attempting to open a file that does not exist or attempting to send data
over a closed socket.
* User-specified errors triggered by application code.
* `AssertionError`s are a special class of error that can be triggered when
Node.js detects an exceptional logic violation that should never occur. These
are raised typically by the `node:assert` module.
* User-specified errors triggered by application code.
All JavaScript and system errors raised by Node.js inherit from, or are
instances of, the standard JavaScript {Error} class and are guaranteed
to provide _at least_ the properties available on that class.
The [`error.message`][] property of errors raised by Node.js may be changed in
any versions. Use [`error.code`][] to identify an error instead. For a
`DOMException`, use [`domException.name`][] to identify its type.
## Error propagation and interception
<!--type=misc-->
@@ -4303,7 +4308,10 @@ An error occurred trying to allocate memory. This should never happen.
[`dgram.createSocket()`]: dgram.md#dgramcreatesocketoptions-callback
[`dgram.disconnect()`]: dgram.md#socketdisconnect
[`dgram.remoteAddress()`]: dgram.md#socketremoteaddress
[`domException.name`]: https://developer.mozilla.org/en-US/docs/Web/API/DOMException/name
[`errno`(3) man page]: https://man7.org/linux/man-pages/man3/errno.3.html
[`error.code`]: #errorcode
[`error.message`]: #errormessage
[`fs.Dir`]: fs.md#class-fsdir
[`fs.cp()`]: fs.md#fscpsrc-dest-options-callback
[`fs.readFileSync`]: fs.md#fsreadfilesyncpath-options