@@ -563,6 +563,13 @@ found [here][online].
563
563
<a id =" nodejs-error-codes " ></a >
564
564
## Node.js Error Codes
565
565
566
+ <a id =" ERR_ARG_NOT_ITERABLE " ></a >
567
+ ### ERR_ARG_NOT_ITERABLE
568
+
569
+ The ` 'ERR_ARG_NOT_ITERABLE' ` error code is used generically to identify that an
570
+ iterable argument (i.e. a value that works with ` for...of ` loops) is required,
571
+ but not provided to a Node.js API.
572
+
566
573
<a id =" ERR_INVALID_ARG_TYPE " ></a >
567
574
### ERR_INVALID_ARG_TYPE
568
575
@@ -575,6 +582,76 @@ an argument of the wrong type has been passed to a Node.js API.
575
582
The ` 'ERR_INVALID_CALLBACK' ` error code is used generically to identify that
576
583
a callback function is required and has not been provided to a Node.js API.
577
584
585
+ <a id =" ERR_INVALID_FILE_URL_HOST " ></a >
586
+ ### ERR_INVALID_FILE_URL_HOST
587
+
588
+ An error with the ` 'ERR_INVALID_FILE_URL_HOST' ` code may be thrown when a
589
+ Node.js API that consumes ` file: ` URLs (such as certain functions in the
590
+ [ ` fs ` ] [ ] module) encounters a file URL with an incompatible host. Currently,
591
+ this situation can only occur on Unix-like systems, where only ` localhost ` or
592
+ an empty host is supported.
593
+
594
+ <a id =" ERR_INVALID_FILE_URL_PATH " ></a >
595
+ ### ERR_INVALID_FILE_URL_PATH
596
+
597
+ An error with the ` 'ERR_INVALID_FILE_URL_PATH' ` code may be thrown when a
598
+ Node.js API that consumes ` file: ` URLs (such as certain functions in the
599
+ [ ` fs ` ] [ ] module) encounters a file URL with an incompatible path. The exact
600
+ semantics for determining whether a path can be used is platform-dependent.
601
+
602
+ <a id =" ERR_INVALID_THIS " ></a >
603
+ ### ERR_INVALID_THIS
604
+
605
+ The ` 'ERR_INVALID_THIS' ` error code is used generically to identify that a
606
+ Node.js API function is called with an incompatible ` this ` value.
607
+
608
+ Example:
609
+
610
+ ``` js
611
+ const { URLSearchParams } = require (' url' );
612
+ const urlSearchParams = new URLSearchParams (' foo=bar&baz=new' );
613
+
614
+ const buf = Buffer .alloc (1 );
615
+ urlSearchParams .has .call (buf, ' foo' );
616
+ // Throws a TypeError with code 'ERR_INVALID_THIS'
617
+ ```
618
+
619
+ <a id =" ERR_INVALID_TUPLE " ></a >
620
+ ### ERR_INVALID_TUPLE
621
+
622
+ An error with code ` 'ERR_INVALID_TUPLE' ` is thrown when an element in the
623
+ ` iterable ` provided to the [ WHATWG] [ WHATWG URL API ] [ ` URLSearchParams `
624
+ constructor] [ `new URLSearchParams(iterable)` ] does not represent a `[ name,
625
+ value] ` tuple – that is, if an element is not iterable, or does not consist of
626
+ exactly two elements.
627
+
628
+ <a id =" ERR_INVALID_URL " ></a >
629
+ ### ERR_INVALID_URL
630
+
631
+ An error using the ` 'ERR_INVALID_URL' ` code is thrown when an invalid URL is
632
+ passed to the [ WHATWG] [ WHATWG URL API ] [ ` URL ` constructor] [ `new URL(input)` ] to
633
+ be parsed. The thrown error object typically has an additional property
634
+ ` 'input' ` that contains the URL that failed to parse.
635
+
636
+ <a id =" ERR_INVALID_URL_SCHEME " ></a >
637
+ ### ERR_INVALID_URL_SCHEME
638
+
639
+ The code ` 'ERR_INVALID_URL_SCHEME' ` is used generically to signify an attempt
640
+ to use a URL of an incompatible scheme (aka protocol) for a specific purpose.
641
+ It is currently only used in the [ WHATWG URL API] [ ] support in the [ ` fs ` ] [ ]
642
+ module (which only accepts URLs with ` 'file' ` scheme), but may be used in other
643
+ Node.js APIs as well in the future.
644
+
645
+ <a id =" ERR_MISSING_ARGS " ></a >
646
+ ### ERR_MISSING_ARGS
647
+
648
+ The ` 'ERR_MISSING_ARGS' ` error code is a generic error code for instances where
649
+ a required argument of a Node.js API is not passed. This is currently only used
650
+ in the [ WHATWG URL API] [ ] for strict compliance with the specification (which
651
+ in some cases may accept ` func(undefined) ` but not ` func() ` ). In most native
652
+ Node.js APIs, ` func(undefined) ` and ` func() ` are treated identically, and the
653
+ [ ` ERR_INVALID_ARG_TYPE ` ] [ ] error code may be used instead.
654
+
578
655
<a id =" ERR_STDERR_CLOSE " ></a >
579
656
### ERR_STDERR_CLOSE
580
657
@@ -627,11 +704,15 @@ likely an indication of a bug within Node.js itself.
627
704
[ `process.on('uncaughtException')` ] : process.html#process_event_uncaughtexception
628
705
[ domains ] : domain.html
629
706
[ event emitter-based ] : events.html#events_class_eventemitter
707
+ [ `ERR_INVALID_ARG_TYPE` ] : #ERR_INVALID_ARG_TYPE
630
708
[ file descriptors ] : https://en.wikipedia.org/wiki/File_descriptor
631
709
[ Node.js Error Codes ] : #nodejs-error-codes
632
710
[ online ] : http://man7.org/linux/man-pages/man3/errno.3.html
633
711
[ stream-based ] : stream.html
634
712
[ syscall ] : http://man7.org/linux/man-pages/man2/syscall.2.html
635
713
[ try-catch ] : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/try...catch
714
+ [ `new URL(input)` ] : url.html#url_constructor_new_url_input_base
715
+ [ `new URLSearchParams(iterable)` ] : url.html#url_constructor_new_urlsearchparams_iterable
636
716
[ V8's stack trace API ] : https://github.com/v8/v8/wiki/Stack-Trace-API
637
717
[ vm ] : vm.html
718
+ [ WHATWG URL API ] : url.html#url_the_whatwg_url_api
0 commit comments