From 3341b2cb9d9fcc307bb158f902ace6822e46a607 Mon Sep 17 00:00:00 2001 From: Benjamin Gruenbaum Date: Sun, 29 Nov 2020 20:11:32 +0200 Subject: [PATCH] doc: document ABORT_ERR code We added an `AbortError` with the same code and name as the web's as part of the consensus in https://github.com/nodejs/node/issues/36084 but never actually documented the error in our error codes list. This PR adds the error code. PR-URL: https://github.com/nodejs/node/pull/36319 Reviewed-By: Matteo Collina Reviewed-By: Luigi Pinca Reviewed-By: Daijiro Wachi Reviewed-By: Anna Henningsen --- doc/api/errors.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/doc/api/errors.md b/doc/api/errors.md index 9433e00897877b..d0e0b8794f09ce 100644 --- a/doc/api/errors.md +++ b/doc/api/errors.md @@ -612,6 +612,18 @@ A human-readable string describing the reason for the error. ## Node.js error codes + +### `ABORT_ERR` + +Used when an operation has been aborted (typically using an `AbortController`). + +APIs _not_ using `AbortSignal`s typically do not raise an error with this code. + +This code does not use the regular `ERR_*` convention Node.js errors use in +order to be compatible with the web platform's `AbortError`. + ### `ERR_AMBIGUOUS_ARGUMENT`