Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0820854

Browse filesBrowse files
trivikrBridgeAR
authored andcommitted
doc,errors: add extends to derived classes
PR-URL: #29303 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 6f056e5 commit 0820854
Copy full SHA for 0820854

File tree

Expand file treeCollapse file tree

3 files changed

+34
-19
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

3 files changed

+34
-19
lines changed
Open diff view settings
Collapse file

‎doc/api/assert.md‎

Copy file name to clipboardExpand all lines: doc/api/assert.md
+4-2Lines changed: 4 additions & 2 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ lenient legacy mode.
1010

1111
## Class: assert.AssertionError
1212

13-
A subclass of `Error` that indicates the failure of an assertion. All errors
14-
thrown by the `assert` module will be instances of the `AssertionError` class.
13+
* Extends: {errors.Error}
14+
15+
Indicates the failure of an assertion. All errors thrown by the `assert` module
16+
will be instances of the `AssertionError` class.
1517

1618
### new assert.AssertionError(options)
1719
<!-- YAML
Collapse file

‎doc/api/errors.md‎

Copy file name to clipboardExpand all lines: doc/api/errors.md
+28-17Lines changed: 28 additions & 17 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ cases. If [domains][] are enabled, or a handler has been registered with
180180

181181
<!--type=class-->
182182

183-
A generic JavaScript `Error` object that does not denote any specific
183+
A generic JavaScript {Error} object that does not denote any specific
184184
circumstance of why the error occurred. `Error` objects capture a "stack trace"
185185
detailing the point in the code at which the `Error` was instantiated, and may
186186
provide a text description of the error.
@@ -352,14 +352,18 @@ loop tick.
352352

353353
## Class: AssertionError
354354

355-
A subclass of `Error` that indicates the failure of an assertion. For details,
356-
see [`Class: assert.AssertionError`][].
355+
* Extends: {errors.Error}
356+
357+
Indicates the failure of an assertion. For details, see
358+
[`Class: assert.AssertionError`][].
357359

358360
## Class: RangeError
359361

360-
A subclass of `Error` that indicates that a provided argument was not within the
361-
set or range of acceptable values for a function; whether that is a numeric
362-
range, or outside the set of options for a given function parameter.
362+
* Extends: {errors.Error}
363+
364+
Indicates that a provided argument was not within the set or range of
365+
acceptable values for a function; whether that is a numeric range, or
366+
outside the set of options for a given function parameter.
363367

364368
```js
365369
require('net').connect(-1);
@@ -371,9 +375,11 @@ of argument validation.
371375

372376
## Class: ReferenceError
373377

374-
A subclass of `Error` that indicates that an attempt is being made to access a
375-
variable that is not defined. Such errors commonly indicate typos in code, or
376-
an otherwise broken program.
378+
* Extends: {errors.Error}
379+
380+
Indicates that an attempt is being made to access a variable that is not
381+
defined. Such errors commonly indicate typos in code, or an otherwise broken
382+
program.
377383

378384
While client code may generate and propagate these errors, in practice, only V8
379385
will do so.
@@ -389,11 +395,12 @@ or its dependencies.
389395

390396
## Class: SyntaxError
391397

392-
A subclass of `Error` that indicates that a program is not valid JavaScript.
393-
These errors may only be generated and propagated as a result of code
394-
evaluation. Code evaluation may happen as a result of `eval`, `Function`,
395-
`require`, or [vm][]. These errors are almost always indicative of a broken
396-
program.
398+
* Extends: {errors.Error}
399+
400+
Indicates that a program is not valid JavaScript. These errors may only be
401+
generated and propagated as a result of code evaluation. Code evaluation may
402+
happen as a result of `eval`, `Function`, `require`, or [vm][]. These errors
403+
are almost always indicative of a broken program.
397404

398405
```js
399406
try {
@@ -408,6 +415,8 @@ they may only be caught by other contexts.
408415

409416
## Class: SystemError
410417

418+
* Extends: {errors.Error}
419+
411420
Node.js generates system errors when exceptions occur within its runtime
412421
environment. These usually occur when an application violates an operating
413422
system constraint. For example, a system error will occur if an application
@@ -548,9 +557,11 @@ program. For a comprehensive list, see the [`errno`(3) man page][].
548557

549558
## Class: TypeError
550559

551-
A subclass of `Error` that indicates that a provided argument is not an
552-
allowable type. For example, passing a function to a parameter which expects a
553-
string would be considered a `TypeError`.
560+
* Extends {errors.Error}
561+
562+
Indicates that a provided argument is not an allowable type. For example,
563+
passing a function to a parameter which expects a string would be considered
564+
a `TypeError`.
554565

555566
```js
556567
require('url').parse(() => { });
Collapse file

‎tools/doc/type-parser.js‎

Copy file name to clipboardExpand all lines: tools/doc/type-parser.js
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ const customTypesMap = {
6464

6565
'Domain': 'domain.html#domain_class_domain',
6666

67+
'errors.Error': 'errors.html#errors_class_error',
68+
6769
'import.meta': 'esm.html#esm_import_meta',
6870

6971
'EventEmitter': 'events.html#events_class_eventemitter',

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.