doc: streamline errors.md introductory material

PR-URL: https://github.com/nodejs/node/pull/21138
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
This commit is contained in:
Rich Trott 2018-06-04 12:16:23 -07:00
parent 1252907c6c
commit 4ee50e714c

View File

@ -6,19 +6,13 @@
Applications running in Node.js will generally experience four categories of Applications running in Node.js will generally experience four categories of
errors: errors:
- Standard JavaScript errors such as: - Standard JavaScript errors such as {EvalError}, {SyntaxError}, {RangeError},
- {EvalError} : thrown when a call to `eval()` fails. {ReferenceError}, {TypeError}, and {URIError}.
- {SyntaxError} : thrown in response to improper JavaScript language
syntax.
- {RangeError} : thrown when a value is not within an expected range
- {ReferenceError} : thrown when using undefined variables
- {TypeError} : thrown when passing arguments of the wrong type
- {URIError} : thrown when a global URI handling function is misused.
- System errors triggered by underlying operating system constraints such - System errors triggered by underlying operating system constraints such
as attempting to open a file that does not exist, attempting to send data as attempting to open a file that does not exist or attempting to send data
over a closed socket, etc; over a closed socket.
- And User-specified errors triggered by application code. - User-specified errors triggered by application code.
- `AssertionError`s are a special class of error that can be triggered whenever - `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 Node.js detects an exceptional logic violation that should never occur. These
are raised typically by the `assert` module. are raised typically by the `assert` module.