doc: add docs for AssertionError
Fixes: https://github.com/nodejs/node/issues/12274 PR-URL: https://github.com/nodejs/node/pull/14261 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Khaidi Chu <i@2333.moe>
This commit is contained in:
parent
472a66517a
commit
4796fbc7d8
@ -358,6 +358,18 @@ loop tick.
|
||||
System-level errors are generated as augmented `Error` instances, which are
|
||||
detailed [here](#errors_system_errors).
|
||||
|
||||
## Class: AssertionError
|
||||
|
||||
A subclass of `Error` that indicates the failure of an assertion. Such errors
|
||||
commonly indicate inequality of actual and expected value.
|
||||
|
||||
For example:
|
||||
|
||||
```js
|
||||
assert.strictEqual(1, 2);
|
||||
// AssertionError [ERR_ASSERTION]: 1 === 2
|
||||
```
|
||||
|
||||
## Class: RangeError
|
||||
|
||||
A subclass of `Error` that indicates that a provided argument was not within the
|
||||
|
Loading…
x
Reference in New Issue
Block a user