Skip to content

Commit 2f34bf0

Browse files
jklepatchtniessen
authored andcommitted
doc: removed redundant mentions to error codes
PR-URL: #13627 Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent 3d21569 commit 2f34bf0

File tree

1 file changed

+79
-99
lines changed

1 file changed

+79
-99
lines changed

doc/api/errors.md

Lines changed: 79 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -565,16 +565,14 @@ found [here][online].
565565
<a id="ERR_ARG_NOT_ITERABLE"></a>
566566
### ERR_ARG_NOT_ITERABLE
567567

568-
The `'ERR_ARG_NOT_ITERABLE'` error code is used generically to identify that an
569-
iterable argument (i.e. a value that works with `for...of` loops) is required,
570-
but not provided to a Node.js API.
568+
Used generically to identify that an iterable argument (i.e. a value that works
569+
with `for...of` loops) is required, but not provided to a Node.js API.
571570

572571
<a id="ERR_CONSOLE_WRITABLE_STREAM"></a>
573572
### ERR_CONSOLE_WRITABLE_STREAM
574573

575-
The `ERR_CONSOLE_WRITABLE_STREAM` error code is thrown when `Console` is
576-
instantiated without `stdout` stream or when `stdout` or `stderr` streams
577-
are not writable.
574+
Used when `Console` is instantiated without `stdout` stream or when `stdout` or
575+
`stderr` streams are not writable.
578576

579577
<a id="ERR_FALSY_VALUE_REJECTION"></a>
580578
### ERR_FALSY_VALUE_REJECTION
@@ -585,20 +583,19 @@ API when a callbackified `Promise` is rejected with a falsy value (e.g. `null`).
585583
<a id="ERR_INDEX_OUT_OF_RANGE"></a>
586584
### ERR_INDEX_OUT_OF_RANGE
587585

588-
The `'ERR_INDEX_OUT_OF_RANGE'` error code is used when a given index is out of
589-
the accepted range.
586+
Used when a given index is out of the accepted range.
590587

591588
<a id="ERR_INVALID_ARG_TYPE"></a>
592589
### ERR_INVALID_ARG_TYPE
593590

594-
The `'ERR_INVALID_ARG_TYPE'` error code is used generically to identify that
595-
an argument of the wrong type has been passed to a Node.js API.
591+
Used generically to identify that an argument of the wrong type has been passed
592+
to a Node.js API.
596593

597594
<a id="ERR_INVALID_CALLBACK"></a>
598595
### ERR_INVALID_CALLBACK
599596

600-
The `'ERR_INVALID_CALLBACK'` error code is used generically to identify that
601-
a callback function is required and has not been provided to a Node.js API.
597+
Used generically to identify that a callback function is required and has not
598+
been provided to a Node.js API.
602599

603600
<a id="ERR_INVALID_CURSOR_POS"></a>
604601
### ERR_INVALID_CURSOR_POS
@@ -609,46 +606,44 @@ stream is attempted to move to a specified row without a specified column.
609606
<a id="ERR_INVALID_FILE_URL_HOST"></a>
610607
### ERR_INVALID_FILE_URL_HOST
611608

612-
An error with the `'ERR_INVALID_FILE_URL_HOST'` code may be thrown when a
613-
Node.js API that consumes `file:` URLs (such as certain functions in the
614-
[`fs`][] module) encounters a file URL with an incompatible host. Currently,
615-
this situation can only occur on Unix-like systems, where only `localhost` or
616-
an empty host is supported.
609+
Used when a Node.js API that consumes `file:` URLs (such as certain functions in
610+
the [`fs`][] module) encounters a file URL with an incompatible host. Currently,
611+
this situation can only occur on Unix-like systems, where only `localhost` or an
612+
empty host is supported.
617613

618614
<a id="ERR_INVALID_FILE_URL_PATH"></a>
619615
### ERR_INVALID_FILE_URL_PATH
620616

621-
An error with the `'ERR_INVALID_FILE_URL_PATH'` code may be thrown when a
622-
Node.js API that consumes `file:` URLs (such as certain functions in the
623-
[`fs`][] module) encounters a file URL with an incompatible path. The exact
624-
semantics for determining whether a path can be used is platform-dependent.
617+
Used when a Node.js API that consumes `file:` URLs (such as certain
618+
functions in the [`fs`][] module) encounters a file URL with an incompatible
619+
path. The exact semantics for determining whether a path can be used is
620+
platform-dependent.
625621

626622
<a id="ERR_INVALID_HANDLE_TYPE"></a>
627623
### ERR_INVALID_HANDLE_TYPE
628624

629-
The '`ERR_INVALID_HANDLE_TYPE`' error code is used when an attempt is made to
630-
send an unsupported "handle" over an IPC communication channel to a child
631-
process. See [`child.send()`] and [`process.send()`] for more information.
625+
Used when an attempt is made to send an unsupported "handle" over an IPC
626+
communication channel to a child process. See [`child.send()`] and
627+
[`process.send()`] for more information.
632628

633629
<a id="ERR_INVALID_OPT_VALUE"></a>
634630
### ERR_INVALID_OPT_VALUE
635631

636-
The `'ERR_INVALID_OPT_VALUE'` error code is used generically to identify when
637-
an invalid or unexpected value has been passed in an options object.
632+
Used generically to identify when an invalid or unexpected value has been
633+
passed in an options object.
638634

639635
<a id="ERR_INVALID_SYNC_FORK_INPUT"></a>
640636
### ERR_INVALID_SYNC_FORK_INPUT
641637

642-
The `'ERR_INVALID_SYNC_FORK_INPUT'` error code is used when a `Buffer`,
643-
`Uint8Array` or `string` is provided as stdio input to a synchronous
644-
fork. See the documentation for the [`child_process`](child_process.html)
645-
module for more information.
638+
Used when a `Buffer`, `Uint8Array` or `string` is provided as stdio input to a
639+
synchronous fork. See the documentation for the
640+
[`child_process`](child_process.html) module for more information.
646641

647642
<a id="ERR_INVALID_THIS"></a>
648643
### ERR_INVALID_THIS
649644

650-
The `'ERR_INVALID_THIS'` error code is used generically to identify that a
651-
Node.js API function is called with an incompatible `this` value.
645+
Used generically to identify that a Node.js API function is called with an
646+
incompatible `this` value.
652647

653648
Example:
654649

@@ -664,144 +659,129 @@ urlSearchParams.has.call(buf, 'foo');
664659
<a id="ERR_INVALID_TUPLE"></a>
665660
### ERR_INVALID_TUPLE
666661

667-
An error with code `'ERR_INVALID_TUPLE'` is thrown when an element in the
668-
`iterable` provided to the [WHATWG][WHATWG URL API] [`URLSearchParams`
669-
constructor][`new URLSearchParams(iterable)`] does not represent a `[name,
670-
value]` tuple – that is, if an element is not iterable, or does not consist of
671-
exactly two elements.
662+
Used when an element in the `iterable` provided to the [WHATWG][WHATWG URL
663+
API] [`URLSearchParams`constructor][`new URLSearchParams(iterable)`] does not
664+
represent a `[name, value]` tuple – that is, if an element is not iterable, or
665+
does not consist of exactly two elements.
672666

673667
<a id="ERR_INVALID_URL"></a>
674668
### ERR_INVALID_URL
675669

676-
An error using the `'ERR_INVALID_URL'` code is thrown when an invalid URL is
677-
passed to the [WHATWG][WHATWG URL API] [`URL` constructor][`new URL(input)`] to
678-
be parsed. The thrown error object typically has an additional property
679-
`'input'` that contains the URL that failed to parse.
670+
Used when an invalid URL is passed to the [WHATWG][WHATWG URL API]
671+
[`URL` constructor][`new URL(input)`] to be parsed. The thrown error object
672+
typically has an additional property `'input'` that contains the URL that failed
673+
to parse.
680674

681675
<a id="ERR_INVALID_URL_SCHEME"></a>
682676
### ERR_INVALID_URL_SCHEME
683677

684-
The code `'ERR_INVALID_URL_SCHEME'` is used generically to signify an attempt
685-
to use a URL of an incompatible scheme (aka protocol) for a specific purpose.
686-
It is currently only used in the [WHATWG URL API][] support in the [`fs`][]
687-
module (which only accepts URLs with `'file'` scheme), but may be used in other
688-
Node.js APIs as well in the future.
678+
Used generically to signify an attempt to use a URL of an incompatible scheme
679+
(aka protocol) for a specific purpose. It is currently only used in the
680+
[WHATWG URL API][] support in the [`fs`][] module (which only accepts URLs with
681+
`'file'` scheme), but may be used in other Node.js APIs as well in the future.
689682

690683
<a id="ERR_IPC_CHANNEL_CLOSED"></a>
691684
### ERR_IPC_CHANNEL_CLOSED
692685

693-
The `'ERR_IPC_CHANNEL_CLOSED'` error code is used when an attempt is made to use
694-
an IPC communication channel that has already been closed.
686+
Used when an attempt is made to use an IPC communication channel that has
687+
already been closed.
695688

696689
<a id="ERR_IPC_DISCONNECTED"></a>
697690
### ERR_IPC_DISCONNECTED
698691

699-
The `'ERR_IPC_DISCONNECTED'` error code is used when an attempt is made to
700-
disconnect an already disconnected IPC communication channel between two
701-
Node.js processes. See the documentation for the
702-
[`child_process`](child_process.html) module for more information.
692+
Used when an attempt is made to disconnect an already disconnected IPC
693+
communication channel between two Node.js processes. See the documentation for
694+
the [`child_process`](child_process.html) module for more information.
703695

704696
<a id="ERR_IPC_ONE_PIPE"></a>
705697
### ERR_IPC_ONE_PIPE
706698

707-
The `'ERR_IPC_ONE_PIPE'` error code is used when an attempt is made to create
708-
a child Node.js process using more than one IPC communication channel.
709-
See the documentation for the [`child_process`](child_process.html)
710-
module for more information.
699+
Used when an attempt is made to create a child Node.js process using more than
700+
one IPC communication channel. See the documentation for the
701+
[`child_process`](child_process.html) module for more information.
711702

712703
<a id="ERR_IPC_SYNC_FORK"></a>
713704
### ERR_IPC_SYNC_FORK
714705

715-
The `'ERR_IPC_SYNC_FORK'` error code is used when an attempt is made to open
716-
an IPC communication channel with a synchronous forked Node.js process.
717-
See the documentation for the [`child_process`](child_process.html)
718-
module for more information.
706+
Used when an attempt is made to open an IPC communication channel with a
707+
synchronous forked Node.js process. See the documentation for the
708+
[`child_process`](child_process.html) module for more information.
719709

720710
<a id="ERR_MISSING_ARGS"></a>
721711
### ERR_MISSING_ARGS
722712

723-
The `'ERR_MISSING_ARGS'` error code is a generic error code for instances where
724-
a required argument of a Node.js API is not passed. This is currently only used
725-
in the [WHATWG URL API][] for strict compliance with the specification (which
726-
in some cases may accept `func(undefined)` but not `func()`). In most native
727-
Node.js APIs, `func(undefined)` and `func()` are treated identically, and the
728-
[`ERR_INVALID_ARG_TYPE`][] error code may be used instead.
713+
Used when a required argument of a Node.js API is not passed. This is currently
714+
only used in the [WHATWG URL API][] for strict compliance with the specification
715+
(which in some cases may accept `func(undefined)` but not `func()`). In most
716+
native Node.js APIs, `func(undefined)` and `func()` are treated identically, and
717+
the [`ERR_INVALID_ARG_TYPE`][] error code may be used instead.
729718

730719
<a id="ERR_SOCKET_ALREADY_BOUND"></a>
731720
### ERR_SOCKET_ALREADY_BOUND
732-
An error using the `'ERR_SOCKET_ALREADY_BOUND'` code is thrown when an attempt
733-
is made to bind a socket that has already been bound.
721+
Used when an attempt is made to bind a socket that has already been bound.
734722

735723
<a id="ERR_SOCKET_BAD_PORT"></a>
736724
### ERR_SOCKET_BAD_PORT
737725

738-
An error using the `'ERR_SOCKET_BAD_PORT'` code is thrown when an API
739-
function expecting a port > 0 and < 65536 receives an invalid value.
726+
Used when an API function expecting a port > 0 and < 65536 receives an invalid
727+
value.
740728

741729
<a id="ERR_SOCKET_BAD_TYPE"></a>
742730
### ERR_SOCKET_BAD_TYPE
743731

744-
An error using the `'ERR_SOCKET_BAD_TYPE'` code is thrown when an API
745-
function expecting a socket type (`udp4` or `udp6`) receives an invalid value.
732+
Used when an API function expecting a socket type (`udp4` or `udp6`) receives an
733+
invalid value.
746734

747735
<a id="ERR_SOCKET_CANNOT_SEND"></a>
748736
### ERR_SOCKET_CANNOT_SEND
749737

750-
An error using the `'ERR_SOCKET_CANNOT_SEND'` code is thrown when data
751-
cannot be sent on a socket.
738+
Used when data cannot be sent on a socket.
752739

753740
<a id="ERR_SOCKET_DGRAM_NOT_RUNNING"></a>
754741
### ERR_SOCKET_DGRAM_NOT_RUNNING
755742

756-
An error using the `'ERR_SOCKET_DGRAM_NOT_RUNNING'` code is thrown
757-
when a call is made and the UDP subsystem is not running.
743+
Used when a call is made and the UDP subsystem is not running.
758744

759745
<a id="ERR_STDERR_CLOSE"></a>
760746
### ERR_STDERR_CLOSE
761747

762-
An error using the `'ERR_STDERR_CLOSE'` code is thrown specifically when an
763-
attempt is made to close the `process.stderr` stream. By design, Node.js does
764-
not allow `stdout` or `stderr` Streams to be closed by user code.
748+
Used when an attempt is made to close the `process.stderr` stream. By design,
749+
Node.js does not allow `stdout` or `stderr` Streams to be closed by user code.
765750

766751
<a id="ERR_STDOUT_CLOSE"></a>
767752
### ERR_STDOUT_CLOSE
768753

769-
An error using the `'ERR_STDOUT_CLOSE'` code is thrown specifically when an
770-
attempt is made to close the `process.stdout` stream. By design, Node.js does
771-
not allow `stdout` or `stderr` Streams to be closed by user code.
754+
Used when an attempt is made to close the `process.stdout` stream. By design,
755+
Node.js does not allow `stdout` or `stderr` Streams to be closed by user code.
772756

773757
<a id="ERR_UNKNOWN_BUILTIN_MODULE"></a>
774758
### ERR_UNKNOWN_BUILTIN_MODULE
775759

776-
The `'ERR_UNKNOWN_BUILTIN_MODULE'` error code is used to identify a specific
777-
kind of internal Node.js error that should not typically be triggered by user
778-
code. Instances of this error point to an internal bug within the Node.js
779-
binary itself.
760+
Used to identify a specific kind of internal Node.js error that should not
761+
typically be triggered by user code. Instances of this error point to an
762+
internal bug within the Node.js binary itself.
780763

781764
<a id="ERR_UNKNOWN_SIGNAL"></a>
782765
### ERR_UNKNOWN_SIGNAL
783766

784-
The `'ERR_UNKNOWN_SIGNAL`' error code is used when an invalid or unknown
785-
process signal is passed to an API expecting a valid signal (such as
786-
[`child.kill()`][]).
767+
Used when an invalid or unknown process signal is passed to an API expecting a
768+
valid signal (such as [`child.kill()`][]).
787769

788770
<a id="ERR_UNKNOWN_STDIN_TYPE"></a>
789771
### ERR_UNKNOWN_STDIN_TYPE
790772

791-
An error using the `'ERR_UNKNOWN_STDIN_TYPE'` code is thrown specifically when
792-
an attempt is made to launch a Node.js process with an unknown `stdin` file
793-
type. Errors of this kind cannot *typically* be caused by errors in user code,
794-
although it is not impossible. Occurrences of this error are most likely an
795-
indication of a bug within Node.js itself.
773+
Used when an attempt is made to launch a Node.js process with an unknown `stdin`
774+
file type. Errors of this kind cannot *typically* be caused by errors in user
775+
code, although it is not impossible. Occurrences of this error are most likely
776+
an indication of a bug within Node.js itself.
796777

797778
<a id="ERR_UNKNOWN_STREAM_TYPE"></a>
798779
### ERR_UNKNOWN_STREAM_TYPE
799780

800-
An error using the `'ERR_UNKNOWN_STREAM_TYPE'` code is thrown specifically when
801-
an attempt is made to launch a Node.js process with an unknown `stdout` or
802-
`stderr` file type. Errors of this kind cannot *typically* be caused by errors
803-
in user code, although it is not impossible. Occurrences of this error are most
804-
likely an indication of a bug within Node.js itself.
781+
Used when an attempt is made to launch a Node.js process with an unknown
782+
`stdout` or `stderr` file type. Errors of this kind cannot *typically* be caused
783+
by errors in user code, although it is not impossible. Occurrences of this error
784+
are most likely an indication of a bug within Node.js itself.
805785

806786

807787
[`ERR_INVALID_ARG_TYPE`]: #ERR_INVALID_ARG_TYPE

0 commit comments

Comments
 (0)