From 06ac81e7869d8200dc6d3ece8625efea94762769 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Mon, 4 Jun 2018 12:16:23 -0700 Subject: [PATCH] doc: streamline errors.md introductory material PR-URL: https://github.com/nodejs/node/pull/21138 Reviewed-By: Luigi Pinca Reviewed-By: Trivikram Kamat Reviewed-By: Colin Ihrig Reviewed-By: Vse Mozhet Byt --- doc/api/errors.md | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/doc/api/errors.md b/doc/api/errors.md index 3680d742c547fd..6fa1e8a7797138 100644 --- a/doc/api/errors.md +++ b/doc/api/errors.md @@ -6,19 +6,13 @@ Applications running in Node.js will generally experience four categories of errors: -- Standard JavaScript errors such as: - - {EvalError} : thrown when a call to `eval()` fails. - - {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. +- Standard JavaScript errors such as {EvalError}, {SyntaxError}, {RangeError}, + {ReferenceError}, {TypeError}, and {URIError}. - System errors triggered by underlying operating system constraints such - as attempting to open a file that does not exist, attempting to send data - over a closed socket, etc; -- And User-specified errors triggered by application code. -- `AssertionError`s are a special class of error that can be triggered whenever + 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 `assert` module.