diff options
author | Kamat, Trivikram <16024985+trivikr@users.noreply.github.com> | 2019-08-24 18:35:50 -0700 |
---|---|---|
committer | Kamat, Trivikram <16024985+trivikr@users.noreply.github.com> | 2019-08-26 18:49:41 -0700 |
commit | 5c9209bc4d9f5e7da78eb03824ad27add5324bc8 (patch) | |
tree | b2b4c4332825cd85f2e8404790a576dbd278a149 | |
parent | 33ae95c58da835086e6f9581715208c2d6ecfd70 (diff) | |
download | node-new-5c9209bc4d9f5e7da78eb03824ad27add5324bc8.tar.gz |
doc,errors: add extends to derived classes
PR-URL: https://github.com/nodejs/node/pull/29303
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
-rw-r--r-- | doc/api/assert.md | 6 | ||||
-rw-r--r-- | doc/api/errors.md | 45 | ||||
-rw-r--r-- | tools/doc/type-parser.js | 2 |
3 files changed, 34 insertions, 19 deletions
diff --git a/doc/api/assert.md b/doc/api/assert.md index fb33994df1..6057ba5c2a 100644 --- a/doc/api/assert.md +++ b/doc/api/assert.md @@ -10,8 +10,10 @@ lenient legacy mode. ## Class: assert.AssertionError -A subclass of `Error` that indicates the failure of an assertion. All errors -thrown by the `assert` module will be instances of the `AssertionError` class. +* Extends: {errors.Error} + +Indicates the failure of an assertion. All errors thrown by the `assert` module +will be instances of the `AssertionError` class. ### new assert.AssertionError(options) <!-- YAML diff --git a/doc/api/errors.md b/doc/api/errors.md index a812d74c8f..b2dafd42de 100644 --- a/doc/api/errors.md +++ b/doc/api/errors.md @@ -180,7 +180,7 @@ cases. If [domains][] are enabled, or a handler has been registered with <!--type=class--> -A generic JavaScript `Error` object that does not denote any specific +A generic JavaScript {Error} object that does not denote any specific circumstance of why the error occurred. `Error` objects capture a "stack trace" detailing the point in the code at which the `Error` was instantiated, and may provide a text description of the error. @@ -352,14 +352,18 @@ loop tick. ## Class: AssertionError -A subclass of `Error` that indicates the failure of an assertion. For details, -see [`Class: assert.AssertionError`][]. +* Extends: {errors.Error} + +Indicates the failure of an assertion. For details, see +[`Class: assert.AssertionError`][]. ## Class: RangeError -A subclass of `Error` that indicates that a provided argument was not within the -set or range of acceptable values for a function; whether that is a numeric -range, or outside the set of options for a given function parameter. +* Extends: {errors.Error} + +Indicates that a provided argument was not within the set or range of +acceptable values for a function; whether that is a numeric range, or +outside the set of options for a given function parameter. ```js require('net').connect(-1); @@ -371,9 +375,11 @@ of argument validation. ## Class: ReferenceError -A subclass of `Error` that indicates that an attempt is being made to access a -variable that is not defined. Such errors commonly indicate typos in code, or -an otherwise broken program. +* Extends: {errors.Error} + +Indicates that an attempt is being made to access a variable that is not +defined. Such errors commonly indicate typos in code, or an otherwise broken +program. While client code may generate and propagate these errors, in practice, only V8 will do so. @@ -389,11 +395,12 @@ or its dependencies. ## Class: SyntaxError -A subclass of `Error` that indicates that a program is not valid JavaScript. -These errors may only be generated and propagated as a result of code -evaluation. Code evaluation may happen as a result of `eval`, `Function`, -`require`, or [vm][]. These errors are almost always indicative of a broken -program. +* Extends: {errors.Error} + +Indicates that a program is not valid JavaScript. These errors may only be +generated and propagated as a result of code evaluation. Code evaluation may +happen as a result of `eval`, `Function`, `require`, or [vm][]. These errors +are almost always indicative of a broken program. ```js try { @@ -408,6 +415,8 @@ they may only be caught by other contexts. ## Class: SystemError +* Extends: {errors.Error} + Node.js generates system errors when exceptions occur within its runtime environment. These usually occur when an application violates an operating system constraint. For example, a system error will occur if an application @@ -550,9 +559,11 @@ program. For a comprehensive list, see the [`errno`(3) man page][]. ## Class: TypeError -A subclass of `Error` that indicates that a provided argument is not an -allowable type. For example, passing a function to a parameter which expects a -string would be considered a `TypeError`. +* Extends {errors.Error} + +Indicates that a provided argument is not an allowable type. For example, +passing a function to a parameter which expects a string would be considered +a `TypeError`. ```js require('url').parse(() => { }); diff --git a/tools/doc/type-parser.js b/tools/doc/type-parser.js index 6acc4196a3..c2c1147639 100644 --- a/tools/doc/type-parser.js +++ b/tools/doc/type-parser.js @@ -64,6 +64,8 @@ const customTypesMap = { 'Domain': 'domain.html#domain_class_domain', + 'errors.Error': 'errors.html#errors_class_error', + 'import.meta': 'esm.html#esm_import_meta', 'EventEmitter': 'events.html#events_class_eventemitter', |