Skip to content

Commit d3b0722

Browse files
Mandeep Singhaddaleax
Mandeep Singh
authored andcommitted
doc: add docs for AssertionError
Fixes: #12274 PR-URL: #14261 Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Khaidi Chu <[email protected]>
1 parent c94f346 commit d3b0722

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

doc/api/errors.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,18 @@ loop tick.
358358
System-level errors are generated as augmented `Error` instances, which are
359359
detailed [here](#errors_system_errors).
360360

361+
## Class: AssertionError
362+
363+
A subclass of `Error` that indicates the failure of an assertion. Such errors
364+
commonly indicate inequality of actual and expected value.
365+
366+
For example:
367+
368+
```js
369+
assert.strictEqual(1, 2);
370+
// AssertionError [ERR_ASSERTION]: 1 === 2
371+
```
372+
361373
## Class: RangeError
362374

363375
A subclass of `Error` that indicates that a provided argument was not within the

0 commit comments

Comments
 (0)