@@ -622,6 +622,8 @@ E('ERR_CRYPTO_HASH_FINALIZED', 'Digest already called', Error);
622
622
E ( 'ERR_CRYPTO_HASH_UPDATE_FAILED' , 'Hash update failed' , Error ) ;
623
623
E ( 'ERR_CRYPTO_INVALID_DIGEST' , 'Invalid digest: %s' , TypeError ) ;
624
624
E ( 'ERR_CRYPTO_INVALID_STATE' , 'Invalid state for operation %s' , Error ) ;
625
+
626
+ // Switch to TypeError. The current implementation does not seem right.
625
627
E ( 'ERR_CRYPTO_SIGN_KEY_REQUIRED' , 'No key provided to sign' , Error ) ;
626
628
E ( 'ERR_CRYPTO_TIMING_SAFE_EQUAL_LENGTH' ,
627
629
'Input buffers must have the same length' , RangeError ) ;
@@ -643,7 +645,7 @@ E('ERR_ENCODING_NOT_SUPPORTED', 'The "%s" encoding is not supported',
643
645
E ( 'ERR_FALSY_VALUE_REJECTION' , 'Promise was rejected with falsy value' , Error ) ;
644
646
E ( 'ERR_FS_INVALID_SYMLINK_TYPE' ,
645
647
'Symlink type must be one of "dir", "file", or "junction". Received "%s"' ,
646
- Error ) ;
648
+ Error ) ; // Switch to TypeError. The current implementation does not seem right
647
649
E ( 'ERR_HTTP2_ALTSVC_INVALID_ORIGIN' ,
648
650
'HTTP/2 ALTSVC frames require a valid origin' , TypeError ) ;
649
651
E ( 'ERR_HTTP2_ALTSVC_LENGTH' ,
@@ -659,10 +661,14 @@ E('ERR_HTTP2_GOAWAY_SESSION',
659
661
E ( 'ERR_HTTP2_HEADERS_AFTER_RESPOND' ,
660
662
'Cannot specify additional headers after response initiated' , Error ) ;
661
663
E ( 'ERR_HTTP2_HEADERS_SENT' , 'Response has already been initiated.' , Error ) ;
664
+
665
+ // This should probably be a `TypeError`.
662
666
E ( 'ERR_HTTP2_HEADER_SINGLE_VALUE' ,
663
667
'Header field "%s" must have only a single value' , Error ) ;
664
668
E ( 'ERR_HTTP2_INFO_STATUS_NOT_ALLOWED' ,
665
669
'Informational status codes cannot be used' , RangeError ) ;
670
+
671
+ // This should probably be a `TypeError`.
666
672
E ( 'ERR_HTTP2_INVALID_CONNECTION_HEADERS' ,
667
673
'HTTP/1 Connection specific headers are forbidden: "%s"' , Error ) ;
668
674
E ( 'ERR_HTTP2_INVALID_HEADER_VALUE' ,
@@ -671,6 +677,8 @@ E('ERR_HTTP2_INVALID_INFO_STATUS',
671
677
'Invalid informational status code: %s' , RangeError ) ;
672
678
E ( 'ERR_HTTP2_INVALID_PACKED_SETTINGS_LENGTH' ,
673
679
'Packed settings length must be a multiple of six' , RangeError ) ;
680
+
681
+ // This should probably be a `TypeError`.
674
682
E ( 'ERR_HTTP2_INVALID_PSEUDOHEADER' ,
675
683
'"%s" is an invalid pseudoheader or is used incorrectly' , Error ) ;
676
684
E ( 'ERR_HTTP2_INVALID_SESSION' , 'The session has been destroyed' , Error ) ;
@@ -689,6 +697,8 @@ E('ERR_HTTP2_PAYLOAD_FORBIDDEN',
689
697
'Responses with %s status must not have a payload' , Error ) ;
690
698
E ( 'ERR_HTTP2_PING_CANCEL' , 'HTTP2 ping cancelled' , Error ) ;
691
699
E ( 'ERR_HTTP2_PING_LENGTH' , 'HTTP2 ping payload must be 8 bytes' , RangeError ) ;
700
+
701
+ // This should probably be a `TypeError`.
692
702
E ( 'ERR_HTTP2_PSEUDOHEADER_NOT_ALLOWED' ,
693
703
'Cannot set HTTP/2 pseudo-headers' , Error ) ;
694
704
E ( 'ERR_HTTP2_PUSH_DISABLED' , 'HTTP/2 client has disabled push streams' , Error ) ;
@@ -736,8 +746,12 @@ E('ERR_INVALID_BUFFER_SIZE',
736
746
'Buffer size must be a multiple of %s' , RangeError ) ;
737
747
E ( 'ERR_INVALID_CALLBACK' , 'Callback must be a function' , TypeError ) ;
738
748
E ( 'ERR_INVALID_CHAR' , invalidChar , TypeError ) ; //Check falsy "Error" entries.
749
+
750
+ // This should probably be a `TypeError`.
739
751
E ( 'ERR_INVALID_CURSOR_POS' ,
740
752
'Cannot set cursor row without setting its column' , Error ) ;
753
+
754
+ // This should probably be a `TypeError`.
741
755
E ( 'ERR_INVALID_DOMAIN_NAME' , 'Unable to determine the domain name' , Error ) ;
742
756
E ( 'ERR_INVALID_FD' ,
743
757
'"fd" must be a positive integer: %s' , RangeError ) ;
@@ -747,6 +761,8 @@ E('ERR_INVALID_FILE_URL_HOST',
747
761
E ( 'ERR_INVALID_FILE_URL_PATH' , 'File URL path %s' , TypeError ) ;
748
762
E ( 'ERR_INVALID_HANDLE_TYPE' , 'This handle type cannot be sent' , TypeError ) ;
749
763
E ( 'ERR_INVALID_HTTP_TOKEN' , '%s must be a valid HTTP token ["%s"]' , TypeError ) ;
764
+
765
+ // The `Error` should probably be a `TypeError`.
750
766
E ( 'ERR_INVALID_IP_ADDRESS' , 'Invalid IP address: %s' , TypeError , [ Error ] ) ;
751
767
E ( 'ERR_INVALID_OPT_VALUE' , ( name , value ) =>
752
768
`The value "${ String ( value ) } " is invalid for option "${ name } "` ,
@@ -756,7 +772,11 @@ E('ERR_INVALID_OPT_VALUE_ENCODING',
756
772
'The value "%s" is invalid for option "encoding"' , TypeError ) ;
757
773
E ( 'ERR_INVALID_PERFORMANCE_MARK' ,
758
774
'The "%s" performance mark has not been set' , Error ) ;
775
+
776
+ // This should probably be a `TypeError`.
759
777
E ( 'ERR_INVALID_PROTOCOL' , 'Protocol "%s" not supported. Expected "%s"' , Error ) ;
778
+
779
+ // This should probably be a `TypeError`.
760
780
E ( 'ERR_INVALID_REPL_EVAL_CONFIG' ,
761
781
'Cannot specify both "breakEvalOnSigint" and "eval" for REPL' , Error ) ;
762
782
E ( 'ERR_INVALID_SYNC_FORK_INPUT' ,
@@ -829,13 +849,17 @@ E('ERR_TLS_DH_PARAM_SIZE', 'DH parameter size %s is less than 2048', Error);
829
849
E ( 'ERR_TLS_HANDSHAKE_TIMEOUT' , 'TLS handshake timeout' , Error ) ;
830
850
E ( 'ERR_TLS_RENEGOTIATION_DISABLED' ,
831
851
'TLS session renegotiation disabled for this socket' , Error ) ;
852
+
853
+ // This should probably be a `TypeError`.
832
854
E ( 'ERR_TLS_REQUIRED_SERVER_NAME' ,
833
855
'"servername" is required parameter for Server.addContext' , Error ) ;
834
856
E ( 'ERR_TLS_SESSION_ATTACK' , 'TLS session renegotiation attack detected' , Error ) ;
835
857
E ( 'ERR_TLS_SNI_FROM_SERVER' ,
836
858
'Cannot issue SNI from a TLS server-side socket' , Error ) ;
837
859
E ( 'ERR_TRANSFORM_ALREADY_TRANSFORMING' ,
838
860
'Calling transform done when still transforming' , Error ) ;
861
+
862
+ // This should probably be a `RangeError`.
839
863
E ( 'ERR_TRANSFORM_WITH_LENGTH_0' ,
840
864
'Calling transform done when writableState.length != 0' , Error ) ;
841
865
E ( 'ERR_UNCAUGHT_EXCEPTION_CAPTURE_ALREADY_SET' ,
@@ -850,14 +874,20 @@ E('ERR_UNHANDLED_ERROR',
850
874
return `${ msg } (${ err } )` ;
851
875
} , Error ) ;
852
876
E ( 'ERR_UNKNOWN_ENCODING' , 'Unknown encoding: %s' , TypeError ) ;
877
+
878
+ // This should probably be a `TypeError`.
853
879
E ( 'ERR_UNKNOWN_FILE_EXTENSION' , 'Unknown file extension: %s' , Error ) ;
854
880
E ( 'ERR_UNKNOWN_MODULE_FORMAT' , 'Unknown module format: %s' , RangeError ) ;
855
881
E ( 'ERR_UNKNOWN_SIGNAL' , 'Unknown signal: %s' , TypeError ) ;
856
882
E ( 'ERR_UNKNOWN_STDIN_TYPE' , 'Unknown stdin file type' , Error ) ;
883
+
884
+ // This should probably be a `TypeError`.
857
885
E ( 'ERR_UNKNOWN_STREAM_TYPE' , 'Unknown stream file type' , Error ) ;
858
886
E ( 'ERR_V8BREAKITERATOR' ,
859
887
'Full ICU data not installed. See https://github.com/nodejs/node/wiki/Intl' ,
860
888
Error ) ;
889
+
890
+ // This should probably be a `TypeError`.
861
891
E ( 'ERR_VALID_PERFORMANCE_ENTRY_TYPE' ,
862
892
'At least one valid performance entry type is required' , Error ) ;
863
893
E ( 'ERR_VM_MODULE_ALREADY_LINKED' , 'Module has already been linked' , Error ) ;
0 commit comments