From d3b072276b0e11364bf0a25547ec9c1bc1e4e373 Mon Sep 17 00:00:00 2001 From: Mandeep Singh Date: Sun, 16 Jul 2017 11:32:04 +0530 Subject: [PATCH] doc: add docs for AssertionError MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: https://github.com/nodejs/node/issues/12274 PR-URL: https://github.com/nodejs/node/pull/14261 Reviewed-By: Vse Mozhet Byt Reviewed-By: Gibson Fahnestock Reviewed-By: Colin Ihrig Reviewed-By: Tobias Nießen Reviewed-By: James M Snell Reviewed-By: Khaidi Chu --- doc/api/errors.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/doc/api/errors.md b/doc/api/errors.md index 570832237c485d..da63708dd49923 100644 --- a/doc/api/errors.md +++ b/doc/api/errors.md @@ -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