Skip to content

Commit fb477f3

Browse files
committed
doc: add missing error codes
PR-URL: #16450 Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Teddy Katz <[email protected]>
1 parent eeada6c commit fb477f3

File tree

1 file changed

+92
-0
lines changed

1 file changed

+92
-0
lines changed

doc/api/errors.md

+92
Original file line numberDiff line numberDiff line change
@@ -643,11 +643,36 @@ Used when an invalid value for the `format` argument has been passed to the
643643
Used when an invalid crypto engine identifier is passed to
644644
[`require('crypto').setEngine()`][].
645645

646+
<a id="ERR_CRYPTO_HASH_DIGEST_NO_UTF16"></a>
647+
### ERR_CRYPTO_HASH_DIGEST_NO_UTF16
648+
649+
Used when the UTF-16 encoding is used with [`hash.digest()`][]. While the
650+
`hash.digest()` method does allow an `encoding` argument to be passed in,
651+
causing the method to return a string rather than a `Buffer`, the UTF-16
652+
encoding (e.g. `ucs` or `utf16le`) is not supported.
653+
654+
<a id="ERR_CRYPTO_HASH_FINALIZED"></a>
655+
### ERR_CRYPTO_HASH_FINALIZED
656+
657+
Used when [`hash.digest()`][] is called multiple times. The `hash.digest()`
658+
method must be called no more than one time per instance of a `Hash` object.
659+
660+
<a id="ERR_CRYPTO_HASH_UPDATE_FAILED"></a>
661+
### ERR_CRYPTO_HASH_UPDATE_FAILED
662+
663+
Used when [`hash.update()`][] fails for any reason. This should rarely, if
664+
ever, happen.
665+
646666
<a id="ERR_CRYPTO_INVALID_DIGEST"></a>
647667
### ERR_CRYPTO_INVALID_DIGEST
648668

649669
Used when an invalid [crypto digest algorithm][] is specified.
650670

671+
<a id="ERR_CRYPTO_SIGN_KEY_REQUIRED"></a>
672+
### ERR_CRYPTO_SIGN_KEY_REQUIRED
673+
674+
Used when a signing `key` is not provided to the [`sign.sign()`][] method.
675+
651676
<a id="ERR_CRYPTO_TIMING_SAFE_EQUAL_LENGTH"></a>
652677
### ERR_CRYPTO_TIMING_SAFE_EQUAL_LENGTH
653678

@@ -1137,6 +1162,20 @@ for strict compliance with the API specification (which in some cases may accept
11371162
`func(undefined)` and `func()` are treated identically, and the
11381163
[`ERR_INVALID_ARG_TYPE`][] error code may be used instead.
11391164

1165+
<a id="ERR_MISSING_MODULE"></a>
1166+
### ERR_MISSING_MODULE
1167+
1168+
> Stability: 1 - Experimental
1169+
1170+
Used when an [ES6 module][] cannot be resolved.
1171+
1172+
<a id="ERR_MODULE_RESOLUTION_LEGACY"></a>
1173+
### ERR_MODULE_RESOLUTION_LEGACY
1174+
1175+
> Stability: 1 - Experimental
1176+
1177+
Used when a failure occurs resolving imports in an [ES6 module][].
1178+
11401179
<a id="ERR_MULTIPLE_CALLBACK"></a>
11411180
### ERR_MULTIPLE_CALLBACK
11421181

@@ -1181,16 +1220,42 @@ For example: `Buffer.write(string, encoding, offset[, length])`
11811220
Used generically to identify that an operation caused an out of memory
11821221
condition.
11831222

1223+
<a id="ERR_OUT_OF_RANGE"></a>
1224+
### ERR_OUT_OF_RANGE
1225+
1226+
Used generically when an input argument value values outside an acceptable
1227+
range.
1228+
11841229
<a id="ERR_PARSE_HISTORY_DATA"></a>
11851230
### ERR_PARSE_HISTORY_DATA
11861231

11871232
Used by the `REPL` module when it cannot parse data from the REPL history file.
11881233

1234+
<a id="ERR_REQUIRE_ESM"></a>
1235+
### ERR_REQUIRE_ESM
1236+
1237+
> Stability: 1 - Experimental
1238+
1239+
Used when an attempt is made to `require()` an [ES6 module][].
1240+
1241+
<a id="ERR_SERVER_ALREADY_LISTEN"></a>
1242+
### ERR_SERVER_ALREADY_LISTEN
1243+
1244+
Used when the [`server.listen()`][] method is called while a `net.Server` is
1245+
already listening. This applies to all instances of `net.Server`, including
1246+
HTTP, HTTPS, and HTTP/2 Server instances.
1247+
11891248
<a id="ERR_SOCKET_ALREADY_BOUND"></a>
11901249
### ERR_SOCKET_ALREADY_BOUND
11911250

11921251
Used when an attempt is made to bind a socket that has already been bound.
11931252

1253+
<a id="ERR_SOCKET_BAD_BUFFER_SIZE"></a>
1254+
### ERR_SOCKET_BAD_BUFFER_SIZE
1255+
1256+
Used when an invalid (negative) size is passed for either the `recvBufferSize`
1257+
or `sendBufferSize` options in [`dgram.createSocket()`][].
1258+
11941259
<a id="ERR_SOCKET_BAD_PORT"></a>
11951260
### ERR_SOCKET_BAD_PORT
11961261

@@ -1203,6 +1268,12 @@ value.
12031268
Used when an API function expecting a socket type (`udp4` or `udp6`) receives an
12041269
invalid value.
12051270

1271+
<a id="ERR_SOCKET_BUFFER_SIZE"></a>
1272+
### ERR_SOCKET_BUFFER_SIZE
1273+
1274+
Used when using [`dgram.createSocket()`][] and the size of the receive or send
1275+
`Buffer` cannot be determined.
1276+
12061277
<a id="ERR_SOCKET_CANNOT_SEND"></a>
12071278
### ERR_SOCKET_CANNOT_SEND
12081279

@@ -1309,6 +1380,21 @@ is emitted by an `EventEmitter` but an `'error'` handler is not registered).
13091380

13101381
Used when an invalid or unknown encoding option is passed to an API.
13111382

1383+
<a id="ERR_UNKNOWN_FILE_EXTENSION"></a>
1384+
### ERR_UNKNOWN_FILE_EXTENSION
1385+
1386+
> Stability: 1 - Experimental
1387+
1388+
Used when attempting to load a module with an unknown or unsupported file
1389+
extension.
1390+
1391+
<a id="ERR_UNKNOWN_MODULE_FORMAT"></a>
1392+
### ERR_UNKNOWN_MODULE_FORMAT
1393+
1394+
> Stability: 1 - Experimental
1395+
1396+
Used when attempting to load a module with an unknown or unsupported format.
1397+
13121398
<a id="ERR_UNKNOWN_SIGNAL"></a>
13131399
### ERR_UNKNOWN_SIGNAL
13141400

@@ -1355,7 +1441,11 @@ Used when an attempt is made to use a `zlib` object after it has already been
13551441
closed.
13561442

13571443
[`crypto.timingSafeEqual()`]: crypto.html#crypto_crypto_timingsafeequal_a_b
1444+
[`dgram.createSocket()`]: dgram.html#dgram_dgram_createsocket_options_callback
13581445
[`ERR_INVALID_ARG_TYPE`]: #ERR_INVALID_ARG_TYPE
1446+
[`hash.digest()`]: crypto.html#crypto_hash_digest_encoding
1447+
[`hash.update()`]: crypto.html#crypto_hash_update_data_inputencoding
1448+
[`sign.sign()`]: crypto.html#crypto_sign_sign_privatekey_outputformat
13591449
[`subprocess.kill()`]: child_process.html#child_process_subprocess_kill_signal
13601450
[`subprocess.send()`]: child_process.html#child_process_subprocess_send_message_sendhandle_options_callback
13611451
[`fs.readFileSync`]: fs.html#fs_fs_readfilesync_path_options
@@ -1371,6 +1461,8 @@ closed.
13711461
[`process.on('uncaughtException')`]: process.html#process_event_uncaughtexception
13721462
[`process.send()`]: process.html#process_process_send_message_sendhandle_options_callback
13731463
[`require('crypto').setEngine()`]: crypto.html#crypto_crypto_setengine_engine_flags
1464+
[`server.listen()`]: net.html#net_server_listen
1465+
[ES6 module]: esm.html
13741466
[Node.js Error Codes]: #nodejs-error-codes
13751467
[V8's stack trace API]: https://github.com/v8/v8/wiki/Stack-Trace-API
13761468
[WHATWG URL API]: url.html#url_the_whatwg_url_api

0 commit comments

Comments
 (0)