| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent f2159f2 commit 01cad99
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,23 +4,28 @@ | |||
| 4 | 4 | ||
| 5 | 5 | <!--type=misc--> | |
| 6 | 6 | ||
| 7 | - Applications running in Node.js will generally experience four categories of | ||
| 8 | - errors: | ||
| 7 | + Applications running in Node.js will generally experience the following | ||
| 8 | + categories of errors: | ||
| 9 | 9 | ||
| 10 | 10 | * Standard JavaScript errors such as {EvalError}, {SyntaxError}, {RangeError}, | |
| 11 | 11 | {ReferenceError}, {TypeError}, and {URIError}. | |
| 12 | + * Standard `DOMException`s. | ||
| 12 | 13 | * System errors triggered by underlying operating system constraints such | |
| 13 | 14 | as attempting to open a file that does not exist or attempting to send data | |
| 14 | 15 | over a closed socket. | |
| 15 | - * User-specified errors triggered by application code. | ||
| 16 | 16 | * `AssertionError`s are a special class of error that can be triggered when | |
| 17 | 17 | Node.js detects an exceptional logic violation that should never occur. These | |
| 18 | 18 | are raised typically by the `node:assert` module. | |
| 19 | + * User-specified errors triggered by application code. | ||
| 19 | 20 | ||
| 20 | 21 | All JavaScript and system errors raised by Node.js inherit from, or are | |
| 21 | 22 | instances of, the standard JavaScript {Error} class and are guaranteed | |
| 22 | 23 | to provide _at least_ the properties available on that class. | |
| 23 | 24 | ||
| 25 | + The [`error.message`][] property of errors raised by Node.js may be changed in | ||
| 26 | + any versions. Use [`error.code`][] to identify an error instead. For a | ||
| 27 | + `DOMException`, use [`domException.name`][] to identify its type. | ||
| 28 | + | ||
| 24 | 29 | ## Error propagation and interception | |
| 25 | 30 | ||
| 26 | 31 | <!--type=misc--> | |
@@ -4233,7 +4238,10 @@ An error occurred trying to allocate memory. This should never happen. | |||
| 4233 | 4238 | [`dgram.createSocket()`]: dgram.md#dgramcreatesocketoptions-callback | |
| 4234 | 4239 | [`dgram.disconnect()`]: dgram.md#socketdisconnect | |
| 4235 | 4240 | [`dgram.remoteAddress()`]: dgram.md#socketremoteaddress | |
| 4241 | + [`domException.name`]: https://developer.mozilla.org/en-US/docs/Web/API/DOMException/name | ||
| 4236 | 4242 | [`errno`(3) man page]: https://man7.org/linux/man-pages/man3/errno.3.html | |
| 4243 | + [`error.code`]: #errorcode | ||
| 4244 | + [`error.message`]: #errormessage | ||
| 4237 | 4245 | [`fs.Dir`]: fs.md#class-fsdir | |
| 4238 | 4246 | [`fs.cp()`]: fs.md#fscpsrc-dest-options-callback | |
| 4239 | 4247 | [`fs.readFileSync`]: fs.md#fsreadfilesyncpath-options | |
| Back | FazBrowse Home | New Git URL |
0 commit comments