deno.land / std@0.166.0 / node / internal / errors.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.// Copyright Node.js contributors. All rights reserved. MIT License./** NOT IMPLEMENTED * ERR_MANIFEST_ASSERT_INTEGRITY * ERR_QUICSESSION_VERSION_NEGOTIATION * ERR_REQUIRE_ESM * ERR_TLS_CERT_ALTNAME_INVALID * ERR_WORKER_INVALID_EXEC_ARGV * ERR_WORKER_PATH * ERR_QUIC_ERROR * ERR_SYSTEM_ERROR //System error, shouldn't ever happen inside Deno * ERR_TTY_INIT_FAILED //System error, shouldn't ever happen inside Deno * ERR_INVALID_PACKAGE_CONFIG // package.json stuff, probably useless */
import { inspect } from "../internal/util/inspect.mjs";import { codes } from "./error_codes.ts";import { codeMap, errorMap, mapSysErrnoToUvErrno,} from "../internal_binding/uv.ts";import { assert } from "../../_util/asserts.ts";import { isWindows } from "../../_util/os.ts";import { os as osConstants } from "../internal_binding/constants.ts";const { errno: { ENOTDIR, ENOENT },} = osConstants;import { hideStackFrames } from "./hide_stack_frames.ts";import { getSystemErrorName } from "../_utils.ts";
export { errorMap };
const kIsNodeError = Symbol("kIsNodeError");
/** * @see https://github.com/nodejs/node/blob/f3eb224/lib/internal/errors.js */const classRegExp = /^([A-Z][a-z0-9]*)+$/;
/** * @see https://github.com/nodejs/node/blob/f3eb224/lib/internal/errors.js * @description Sorted by a rough estimate on most frequently used entries. */const kTypes = [ "string", "function", "number", "object", // Accept 'Function' and 'Object' as alternative to the lower cased version. "Function", "Object", "boolean", "bigint", "symbol",];
// Node uses an AbortError that isn't exactly the same as the DOMException// to make usage of the error in userland and readable-stream easier.// It is a regular error with `.code` and `.name`.export class AbortError extends Error { code: string;
constructor(message = "The operation was aborted", options?: ErrorOptions) { if (options !== undefined && typeof options !== "object") { throw new codes.ERR_INVALID_ARG_TYPE("options", "Object", options); } super(message, options); this.code = "ABORT_ERR"; this.name = "AbortError"; }}
let maxStack_ErrorName: string | undefined;let maxStack_ErrorMessage: string | undefined;/** * Returns true if `err.name` and `err.message` are equal to engine-specific * values indicating max call stack size has been exceeded. * "Maximum call stack size exceeded" in V8. */export function isStackOverflowError(err: Error): boolean { if (maxStack_ErrorMessage === undefined) { try { // deno-lint-ignore no-inner-declarations function overflowStack() { overflowStack(); } overflowStack(); // deno-lint-ignore no-explicit-any } catch (err: any) { maxStack_ErrorMessage = err.message; maxStack_ErrorName = err.name; } }
return err && err.name === maxStack_ErrorName && err.message === maxStack_ErrorMessage;}
function addNumericalSeparator(val: string) { let res = ""; let i = val.length; const start = val[0] === "-" ? 1 : 0; for (; i >= start + 4; i -= 3) { res = `_${val.slice(i - 3, i)}${res}`; } return `${val.slice(0, i)}${res}`;}
const captureLargerStackTrace = hideStackFrames( function captureLargerStackTrace(err) { // @ts-ignore this function is not available in lib.dom.d.ts Error.captureStackTrace(err);
return err; },);
export interface ErrnoException extends Error { errno?: number; code?: string; path?: string; syscall?: string; spawnargs?: string[];}
/** * This creates an error compatible with errors produced in the C++ * This function should replace the deprecated * `exceptionWithHostPort()` function. * * @param err A libuv error number * @param syscall * @param address * @param port * @return The error. */export const uvExceptionWithHostPort = hideStackFrames( function uvExceptionWithHostPort( err: number, syscall: string, address?: string | null, port?: number | null, ) { const { 0: code, 1: uvmsg } = uvErrmapGet(err) || uvUnmappedError; const message = `${syscall} ${code}: ${uvmsg}`; let details = "";
if (port && port > 0) { details = ` ${address}:${port}`; } else if (address) { details = ` ${address}`; }
// deno-lint-ignore no-explicit-any const ex: any = new Error(`${message}${details}`); ex.code = code; ex.errno = err; ex.syscall = syscall; ex.address = address;
if (port) { ex.port = port; }
return captureLargerStackTrace(ex); },);
/** * This used to be `util._errnoException()`. * * @param err A libuv error number * @param syscall * @param original * @return A `ErrnoException` */export const errnoException = hideStackFrames(function errnoException( err, syscall, original?,): ErrnoException { const code = getSystemErrorName(err); const message = original ? `${syscall} ${code} ${original}` : `${syscall} ${code}`;
// deno-lint-ignore no-explicit-any const ex: any = new Error(message); ex.errno = err; ex.code = code; ex.syscall = syscall;
return captureLargerStackTrace(ex);});
function uvErrmapGet(name: number) { return errorMap.get(name);}
const uvUnmappedError = ["UNKNOWN", "unknown error"];
/** * This creates an error compatible with errors produced in the C++ * function UVException using a context object with data assembled in C++. * The goal is to migrate them to ERR_* errors later when compatibility is * not a concern. * * @param ctx * @return The error. */export const uvException = hideStackFrames(function uvException(ctx) { const { 0: code, 1: uvmsg } = uvErrmapGet(ctx.errno) || uvUnmappedError;
let message = `${code}: ${ctx.message || uvmsg}, ${ctx.syscall}`;
let path; let dest;
if (ctx.path) { path = ctx.path.toString(); message += ` '${path}'`; } if (ctx.dest) { dest = ctx.dest.toString(); message += ` -> '${dest}'`; }
// deno-lint-ignore no-explicit-any const err: any = new Error(message);
for (const prop of Object.keys(ctx)) { if (prop === "message" || prop === "path" || prop === "dest") { continue; }
err[prop] = ctx[prop]; }
err.code = code;
if (path) { err.path = path; }
if (dest) { err.dest = dest; }
return captureLargerStackTrace(err);});
/** * Deprecated, new function is `uvExceptionWithHostPort()` * New function added the error description directly * from C++. this method for backwards compatibility * @param err A libuv error number * @param syscall * @param address * @param port * @param additional */export const exceptionWithHostPort = hideStackFrames( function exceptionWithHostPort( err: number, syscall: string, address: string, port: number, additional?: string, ) { const code = getSystemErrorName(err); let details = "";
if (port && port > 0) { details = ` ${address}:${port}`; } else if (address) { details = ` ${address}`; }
if (additional) { details += ` - Local (${additional})`; }
// deno-lint-ignore no-explicit-any const ex: any = new Error(`${syscall} ${code}${details}`); ex.errno = err; ex.code = code; ex.syscall = syscall; ex.address = address;
if (port) { ex.port = port; }
return captureLargerStackTrace(ex); },);
/** * @param code A libuv error number or a c-ares error code * @param syscall * @param hostname */export const dnsException = hideStackFrames(function (code, syscall, hostname) { let errno;
// If `code` is of type number, it is a libuv error number, else it is a // c-ares error code. if (typeof code === "number") { errno = code; // ENOTFOUND is not a proper POSIX error, but this error has been in place // long enough that it's not practical to remove it. if ( code === codeMap.get("EAI_NODATA") || code === codeMap.get("EAI_NONAME") ) { code = "ENOTFOUND"; // Fabricated error name. } else { code = getSystemErrorName(code); } }
const message = `${syscall} ${code}${hostname ? ` ${hostname}` : ""}`;
// deno-lint-ignore no-explicit-any const ex: any = new Error(message); ex.errno = errno; ex.code = code; ex.syscall = syscall;
if (hostname) { ex.hostname = hostname; }
return captureLargerStackTrace(ex);});
/** * All error instances in Node have additional methods and properties * This export class is meant to be extended by these instances abstracting native JS error instances */export class NodeErrorAbstraction extends Error { code: string;
constructor(name: string, code: string, message: string) { super(message); this.code = code; this.name = name; //This number changes depending on the name of this class //20 characters as of now this.stack = this.stack && `${name} [${this.code}]${this.stack.slice(20)}`; }
override toString() { return `${this.name} [${this.code}]: ${this.message}`; }}
export class NodeError extends NodeErrorAbstraction { constructor(code: string, message: string) { super(Error.prototype.name, code, message); }}
export class NodeSyntaxError extends NodeErrorAbstraction implements SyntaxError { constructor(code: string, message: string) { super(SyntaxError.prototype.name, code, message); Object.setPrototypeOf(this, SyntaxError.prototype); this.toString = function () { return `${this.name} [${this.code}]: ${this.message}`; }; }}
export class NodeRangeError extends NodeErrorAbstraction { constructor(code: string, message: string) { super(RangeError.prototype.name, code, message); Object.setPrototypeOf(this, RangeError.prototype); this.toString = function () { return `${this.name} [${this.code}]: ${this.message}`; }; }}
export class NodeTypeError extends NodeErrorAbstraction implements TypeError { constructor(code: string, message: string) { super(TypeError.prototype.name, code, message); Object.setPrototypeOf(this, TypeError.prototype); this.toString = function () { return `${this.name} [${this.code}]: ${this.message}`; }; }}
export class NodeURIError extends NodeErrorAbstraction implements URIError { constructor(code: string, message: string) { super(URIError.prototype.name, code, message); Object.setPrototypeOf(this, URIError.prototype); this.toString = function () { return `${this.name} [${this.code}]: ${this.message}`; }; }}
export interface NodeSystemErrorCtx { code: string; syscall: string; message: string; errno: number; path?: string; dest?: string;}// A specialized Error that includes an additional info property with// additional information about the error condition.// It has the properties present in a UVException but with a custom error// message followed by the uv error code and uv error message.// It also has its own error code with the original uv error context put into// `err.info`.// The context passed into this error must have .code, .syscall and .message,// and may have .path and .dest.class NodeSystemError extends NodeErrorAbstraction { constructor(key: string, context: NodeSystemErrorCtx, msgPrefix: string) { let message = `${msgPrefix}: ${context.syscall} returned ` + `${context.code} (${context.message})`;
if (context.path !== undefined) { message += ` ${context.path}`; } if (context.dest !== undefined) { message += ` => ${context.dest}`; }
super("SystemError", key, message);
captureLargerStackTrace(this);
Object.defineProperties(this, { [kIsNodeError]: { value: true, enumerable: false, writable: false, configurable: true, }, info: { value: context, enumerable: true, configurable: true, writable: false, }, errno: { get() { return context.errno; }, set: (value) => { context.errno = value; }, enumerable: true, configurable: true, }, syscall: { get() { return context.syscall; }, set: (value) => { context.syscall = value; }, enumerable: true, configurable: true, }, });
if (context.path !== undefined) { Object.defineProperty(this, "path", { get() { return context.path; }, set: (value) => { context.path = value; }, enumerable: true, configurable: true, }); }
if (context.dest !== undefined) { Object.defineProperty(this, "dest", { get() { return context.dest; }, set: (value) => { context.dest = value; }, enumerable: true, configurable: true, }); } }
override toString() { return `${this.name} [${this.code}]: ${this.message}`; }}
function makeSystemErrorWithCode(key: string, msgPrfix: string) { return class NodeError extends NodeSystemError { constructor(ctx: NodeSystemErrorCtx) { super(key, ctx, msgPrfix); } };}
export const ERR_FS_EISDIR = makeSystemErrorWithCode( "ERR_FS_EISDIR", "Path is a directory",);
function createInvalidArgType( name: string, expected: string | string[],): string { // https://github.com/nodejs/node/blob/f3eb224/lib/internal/errors.js#L1037-L1087 expected = Array.isArray(expected) ? expected : [expected]; let msg = "The "; if (name.endsWith(" argument")) { // For cases like 'first argument' msg += `${name} `; } else { const type = name.includes(".") ? "property" : "argument"; msg += `"${name}" ${type} `; } msg += "must be ";
const types = []; const instances = []; const other = []; for (const value of expected) { if (kTypes.includes(value)) { types.push(value.toLocaleLowerCase()); } else if (classRegExp.test(value)) { instances.push(value); } else { other.push(value); } }
// Special handle `object` in case other instances are allowed to outline // the differences between each other. if (instances.length > 0) { const pos = types.indexOf("object"); if (pos !== -1) { types.splice(pos, 1); instances.push("Object"); } }
if (types.length > 0) { if (types.length > 2) { const last = types.pop(); msg += `one of type ${types.join(", ")}, or ${last}`; } else if (types.length === 2) { msg += `one of type ${types[0]} or ${types[1]}`; } else { msg += `of type ${types[0]}`; } if (instances.length > 0 || other.length > 0) { msg += " or "; } }
if (instances.length > 0) { if (instances.length > 2) { const last = instances.pop(); msg += `an instance of ${instances.join(", ")}, or ${last}`; } else { msg += `an instance of ${instances[0]}`; if (instances.length === 2) { msg += ` or ${instances[1]}`; } } if (other.length > 0) { msg += " or "; } }
if (other.length > 0) { if (other.length > 2) { const last = other.pop(); msg += `one of ${other.join(", ")}, or ${last}`; } else if (other.length === 2) { msg += `one of ${other[0]} or ${other[1]}`; } else { if (other[0].toLowerCase() !== other[0]) { msg += "an "; } msg += `${other[0]}`; } }
return msg;}
export class ERR_INVALID_ARG_TYPE_RANGE extends NodeRangeError { constructor(name: string, expected: string | string[], actual: unknown) { const msg = createInvalidArgType(name, expected);
super("ERR_INVALID_ARG_TYPE", `${msg}.${invalidArgTypeHelper(actual)}`); }}
export class ERR_INVALID_ARG_TYPE extends NodeTypeError { constructor(name: string, expected: string | string[], actual: unknown) { const msg = createInvalidArgType(name, expected);
super("ERR_INVALID_ARG_TYPE", `${msg}.${invalidArgTypeHelper(actual)}`); }
static RangeError = ERR_INVALID_ARG_TYPE_RANGE;}
export class ERR_INVALID_ARG_VALUE_RANGE extends NodeRangeError { constructor(name: string, value: unknown, reason: string = "is invalid") { const type = name.includes(".") ? "property" : "argument"; const inspected = inspect(value);
super( "ERR_INVALID_ARG_VALUE", `The ${type} '${name}' ${reason}. Received ${inspected}`, ); }}
export class ERR_INVALID_ARG_VALUE extends NodeTypeError { constructor(name: string, value: unknown, reason: string = "is invalid") { const type = name.includes(".") ? "property" : "argument"; const inspected = inspect(value);
super( "ERR_INVALID_ARG_VALUE", `The ${type} '${name}' ${reason}. Received ${inspected}`, ); }
static RangeError = ERR_INVALID_ARG_VALUE_RANGE;}
// A helper function to simplify checking for ERR_INVALID_ARG_TYPE output.// deno-lint-ignore no-explicit-anyfunction invalidArgTypeHelper(input: any) { if (input == null) { return ` Received ${input}`; } if (typeof input === "function" && input.name) { return ` Received function ${input.name}`; } if (typeof input === "object") { if (input.constructor && input.constructor.name) { return ` Received an instance of ${input.constructor.name}`; } return ` Received ${inspect(input, { depth: -1 })}`; } let inspected = inspect(input, { colors: false }); if (inspected.length > 25) { inspected = `${inspected.slice(0, 25)}...`; } return ` Received type ${typeof input} (${inspected})`;}
export class ERR_OUT_OF_RANGE extends RangeError { code = "ERR_OUT_OF_RANGE";
constructor( str: string, range: string, input: unknown, replaceDefaultBoolean = false, ) { assert(range, 'Missing "range" argument'); let msg = replaceDefaultBoolean ? str : `The value of "${str}" is out of range.`; let received; if (Number.isInteger(input) && Math.abs(input as number) > 2 ** 32) { received = addNumericalSeparator(String(input)); } else if (typeof input === "bigint") { received = String(input); if (input > 2n ** 32n || input < -(2n ** 32n)) { received = addNumericalSeparator(received); } received += "n"; } else { received = inspect(input); } msg += ` It must be ${range}. Received ${received}`;
super(msg);
const { name } = this; // Add the error code to the name to include it in the stack trace. this.name = `${name} [${this.code}]`; // Access the stack to generate the error message including the error code from the name. this.stack; // Reset the name to the actual name. this.name = name; }}
export class ERR_AMBIGUOUS_ARGUMENT extends NodeTypeError { constructor(x: string, y: string) { super("ERR_AMBIGUOUS_ARGUMENT", `The "${x}" argument is ambiguous. ${y}`); }}
export class ERR_ARG_NOT_ITERABLE extends NodeTypeError { constructor(x: string) { super("ERR_ARG_NOT_ITERABLE", `${x} must be iterable`); }}
export class ERR_ASSERTION extends NodeError { constructor(x: string) { super("ERR_ASSERTION", `${x}`); }}
export class ERR_ASYNC_CALLBACK extends NodeTypeError { constructor(x: string) { super("ERR_ASYNC_CALLBACK", `${x} must be a function`); }}
export class ERR_ASYNC_TYPE extends NodeTypeError { constructor(x: string) { super("ERR_ASYNC_TYPE", `Invalid name for async "type": ${x}`); }}
export class ERR_BROTLI_INVALID_PARAM extends NodeRangeError { constructor(x: string) { super("ERR_BROTLI_INVALID_PARAM", `${x} is not a valid Brotli parameter`); }}
export class ERR_BUFFER_OUT_OF_BOUNDS extends NodeRangeError { constructor(name?: string) { super( "ERR_BUFFER_OUT_OF_BOUNDS", name ? `"${name}" is outside of buffer bounds` : "Attempt to access memory outside buffer bounds", ); }}
export class ERR_BUFFER_TOO_LARGE extends NodeRangeError { constructor(x: string) { super( "ERR_BUFFER_TOO_LARGE", `Cannot create a Buffer larger than ${x} bytes`, ); }}
export class ERR_CANNOT_WATCH_SIGINT extends NodeError { constructor() { super("ERR_CANNOT_WATCH_SIGINT", "Cannot watch for SIGINT signals"); }}
export class ERR_CHILD_CLOSED_BEFORE_REPLY extends NodeError { constructor() { super( "ERR_CHILD_CLOSED_BEFORE_REPLY", "Child closed before reply received", ); }}
export class ERR_CHILD_PROCESS_IPC_REQUIRED extends NodeError { constructor(x: string) { super( "ERR_CHILD_PROCESS_IPC_REQUIRED", `Forked processes must have an IPC channel, missing value 'ipc' in ${x}`, ); }}
export class ERR_CHILD_PROCESS_STDIO_MAXBUFFER extends NodeRangeError { constructor(x: string) { super( "ERR_CHILD_PROCESS_STDIO_MAXBUFFER", `${x} maxBuffer length exceeded`, ); }}
export class ERR_CONSOLE_WRITABLE_STREAM extends NodeTypeError { constructor(x: string) { super( "ERR_CONSOLE_WRITABLE_STREAM", `Console expects a writable stream instance for ${x}`, ); }}
export class ERR_CONTEXT_NOT_INITIALIZED extends NodeError { constructor() { super("ERR_CONTEXT_NOT_INITIALIZED", "context used is not initialized"); }}
export class ERR_CPU_USAGE extends NodeError { constructor(x: string) { super("ERR_CPU_USAGE", `Unable to obtain cpu usage ${x}`); }}
export class ERR_CRYPTO_CUSTOM_ENGINE_NOT_SUPPORTED extends NodeError { constructor() { super( "ERR_CRYPTO_CUSTOM_ENGINE_NOT_SUPPORTED", "Custom engines not supported by this OpenSSL", ); }}
export class ERR_CRYPTO_ECDH_INVALID_FORMAT extends NodeTypeError { constructor(x: string) { super("ERR_CRYPTO_ECDH_INVALID_FORMAT", `Invalid ECDH format: ${x}`); }}
export class ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY extends NodeError { constructor() { super( "ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY", "Public key is not valid for specified curve", ); }}
export class ERR_CRYPTO_ENGINE_UNKNOWN extends NodeError { constructor(x: string) { super("ERR_CRYPTO_ENGINE_UNKNOWN", `Engine "${x}" was not found`); }}
export class ERR_CRYPTO_FIPS_FORCED extends NodeError { constructor() { super( "ERR_CRYPTO_FIPS_FORCED", "Cannot set FIPS mode, it was forced with --force-fips at startup.", ); }}
export class ERR_CRYPTO_FIPS_UNAVAILABLE extends NodeError { constructor() { super( "ERR_CRYPTO_FIPS_UNAVAILABLE", "Cannot set FIPS mode in a non-FIPS build.", ); }}
export class ERR_CRYPTO_HASH_FINALIZED extends NodeError { constructor() { super("ERR_CRYPTO_HASH_FINALIZED", "Digest already called"); }}
export class ERR_CRYPTO_HASH_UPDATE_FAILED extends NodeError { constructor() { super("ERR_CRYPTO_HASH_UPDATE_FAILED", "Hash update failed"); }}
export class ERR_CRYPTO_INCOMPATIBLE_KEY extends NodeError { constructor(x: string, y: string) { super("ERR_CRYPTO_INCOMPATIBLE_KEY", `Incompatible ${x}: ${y}`); }}
export class ERR_CRYPTO_INCOMPATIBLE_KEY_OPTIONS extends NodeError { constructor(x: string, y: string) { super( "ERR_CRYPTO_INCOMPATIBLE_KEY_OPTIONS", `The selected key encoding ${x} ${y}.`, ); }}
export class ERR_CRYPTO_INVALID_DIGEST extends NodeTypeError { constructor(x: string) { super("ERR_CRYPTO_INVALID_DIGEST", `Invalid digest: ${x}`); }}
export class ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE extends NodeTypeError { constructor(x: string, y: string) { super( "ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE", `Invalid key object type ${x}, expected ${y}.`, ); }}
export class ERR_CRYPTO_INVALID_STATE extends NodeError { constructor(x: string) { super("ERR_CRYPTO_INVALID_STATE", `Invalid state for operation ${x}`); }}
export class ERR_CRYPTO_PBKDF2_ERROR extends NodeError { constructor() { super("ERR_CRYPTO_PBKDF2_ERROR", "PBKDF2 error"); }}
export class ERR_CRYPTO_SCRYPT_INVALID_PARAMETER extends NodeError { constructor() { super("ERR_CRYPTO_SCRYPT_INVALID_PARAMETER", "Invalid scrypt parameter"); }}
export class ERR_CRYPTO_SCRYPT_NOT_SUPPORTED extends NodeError { constructor() { super("ERR_CRYPTO_SCRYPT_NOT_SUPPORTED", "Scrypt algorithm not supported"); }}
export class ERR_CRYPTO_SIGN_KEY_REQUIRED extends NodeError { constructor() { super("ERR_CRYPTO_SIGN_KEY_REQUIRED", "No key provided to sign"); }}
export class ERR_DIR_CLOSED extends NodeError { constructor() { super("ERR_DIR_CLOSED", "Directory handle was closed"); }}
export class ERR_DIR_CONCURRENT_OPERATION extends NodeError { constructor() { super( "ERR_DIR_CONCURRENT_OPERATION", "Cannot do synchronous work on directory handle with concurrent asynchronous operations", ); }}
export class ERR_DNS_SET_SERVERS_FAILED extends NodeError { constructor(x: string, y: string) { super( "ERR_DNS_SET_SERVERS_FAILED", `c-ares failed to set servers: "${x}" [${y}]`, ); }}
export class ERR_DOMAIN_CALLBACK_NOT_AVAILABLE extends NodeError { constructor() { super( "ERR_DOMAIN_CALLBACK_NOT_AVAILABLE", "A callback was registered through " + "process.setUncaughtExceptionCaptureCallback(), which is mutually " + "exclusive with using the `domain` module", ); }}
export class ERR_DOMAIN_CANNOT_SET_UNCAUGHT_EXCEPTION_CAPTURE extends NodeError { constructor() { super( "ERR_DOMAIN_CANNOT_SET_UNCAUGHT_EXCEPTION_CAPTURE", "The `domain` module is in use, which is mutually exclusive with calling " + "process.setUncaughtExceptionCaptureCallback()", ); }}
export class ERR_ENCODING_INVALID_ENCODED_DATA extends NodeErrorAbstraction implements TypeError { errno: number; constructor(encoding: string, ret: number) { super( TypeError.prototype.name, "ERR_ENCODING_INVALID_ENCODED_DATA", `The encoded data was not valid for encoding ${encoding}`, ); Object.setPrototypeOf(this, TypeError.prototype);
this.errno = ret; }}
export class ERR_ENCODING_NOT_SUPPORTED extends NodeRangeError { constructor(x: string) { super("ERR_ENCODING_NOT_SUPPORTED", `The "${x}" encoding is not supported`); }}export class ERR_EVAL_ESM_CANNOT_PRINT extends NodeError { constructor() { super("ERR_EVAL_ESM_CANNOT_PRINT", `--print cannot be used with ESM input`); }}export class ERR_EVENT_RECURSION extends NodeError { constructor(x: string) { super( "ERR_EVENT_RECURSION", `The event "${x}" is already being dispatched`, ); }}export class ERR_FEATURE_UNAVAILABLE_ON_PLATFORM extends NodeTypeError { constructor(x: string) { super( "ERR_FEATURE_UNAVAILABLE_ON_PLATFORM", `The feature ${x} is unavailable on the current platform, which is being used to run Node.js`, ); }}export class ERR_FS_FILE_TOO_LARGE extends NodeRangeError { constructor(x: string) { super("ERR_FS_FILE_TOO_LARGE", `File size (${x}) is greater than 2 GB`); }}export class ERR_FS_INVALID_SYMLINK_TYPE extends NodeError { constructor(x: string) { super( "ERR_FS_INVALID_SYMLINK_TYPE", `Symlink type must be one of "dir", "file", or "junction". Received "${x}"`, ); }}export class ERR_HTTP2_ALTSVC_INVALID_ORIGIN extends NodeTypeError { constructor() { super( "ERR_HTTP2_ALTSVC_INVALID_ORIGIN", `HTTP/2 ALTSVC frames require a valid origin`, ); }}export class ERR_HTTP2_ALTSVC_LENGTH extends NodeTypeError { constructor() { super( "ERR_HTTP2_ALTSVC_LENGTH", `HTTP/2 ALTSVC frames are limited to 16382 bytes`, ); }}export class ERR_HTTP2_CONNECT_AUTHORITY extends NodeError { constructor() { super( "ERR_HTTP2_CONNECT_AUTHORITY", `:authority header is required for CONNECT requests`, ); }}export class ERR_HTTP2_CONNECT_PATH extends NodeError { constructor() { super( "ERR_HTTP2_CONNECT_PATH", `The :path header is forbidden for CONNECT requests`, ); }}export class ERR_HTTP2_CONNECT_SCHEME extends NodeError { constructor() { super( "ERR_HTTP2_CONNECT_SCHEME", `The :scheme header is forbidden for CONNECT requests`, ); }}export class ERR_HTTP2_GOAWAY_SESSION extends NodeError { constructor() { super( "ERR_HTTP2_GOAWAY_SESSION", `New streams cannot be created after receiving a GOAWAY`, ); }}export class ERR_HTTP2_HEADERS_AFTER_RESPOND extends NodeError { constructor() { super( "ERR_HTTP2_HEADERS_AFTER_RESPOND", `Cannot specify additional headers after response initiated`, ); }}export class ERR_HTTP2_HEADERS_SENT extends NodeError { constructor() { super("ERR_HTTP2_HEADERS_SENT", `Response has already been initiated.`); }}export class ERR_HTTP2_HEADER_SINGLE_VALUE extends NodeTypeError { constructor(x: string) { super( "ERR_HTTP2_HEADER_SINGLE_VALUE", `Header field "${x}" must only have a single value`, ); }}export class ERR_HTTP2_INFO_STATUS_NOT_ALLOWED extends NodeRangeError { constructor() { super( "ERR_HTTP2_INFO_STATUS_NOT_ALLOWED", `Informational status codes cannot be used`, ); }}export class ERR_HTTP2_INVALID_CONNECTION_HEADERS extends NodeTypeError { constructor(x: string) { super( "ERR_HTTP2_INVALID_CONNECTION_HEADERS", `HTTP/1 Connection specific headers are forbidden: "${x}"`, ); }}export class ERR_HTTP2_INVALID_HEADER_VALUE extends NodeTypeError { constructor(x: string, y: string) { super( "ERR_HTTP2_INVALID_HEADER_VALUE", `Invalid value "${x}" for header "${y}"`, ); }}export class ERR_HTTP2_INVALID_INFO_STATUS extends NodeRangeError { constructor(x: string) { super( "ERR_HTTP2_INVALID_INFO_STATUS", `Invalid informational status code: ${x}`, ); }}export class ERR_HTTP2_INVALID_ORIGIN extends NodeTypeError { constructor() { super( "ERR_HTTP2_INVALID_ORIGIN", `HTTP/2 ORIGIN frames require a valid origin`, ); }}export class ERR_HTTP2_INVALID_PACKED_SETTINGS_LENGTH extends NodeRangeError { constructor() { super( "ERR_HTTP2_INVALID_PACKED_SETTINGS_LENGTH", `Packed settings length must be a multiple of six`, ); }}export class ERR_HTTP2_INVALID_PSEUDOHEADER extends NodeTypeError { constructor(x: string) { super( "ERR_HTTP2_INVALID_PSEUDOHEADER", `"${x}" is an invalid pseudoheader or is used incorrectly`, ); }}export class ERR_HTTP2_INVALID_SESSION extends NodeError { constructor() { super("ERR_HTTP2_INVALID_SESSION", `The session has been destroyed`); }}export class ERR_HTTP2_INVALID_STREAM extends NodeError { constructor() { super("ERR_HTTP2_INVALID_STREAM", `The stream has been destroyed`); }}export class ERR_HTTP2_MAX_PENDING_SETTINGS_ACK extends NodeError { constructor() { super( "ERR_HTTP2_MAX_PENDING_SETTINGS_ACK", `Maximum number of pending settings acknowledgements`, ); }}export class ERR_HTTP2_NESTED_PUSH extends NodeError { constructor() { super( "ERR_HTTP2_NESTED_PUSH", `A push stream cannot initiate another push stream.`, ); }}export class ERR_HTTP2_NO_SOCKET_MANIPULATION extends NodeError { constructor() { super( "ERR_HTTP2_NO_SOCKET_MANIPULATION", `HTTP/2 sockets should not be directly manipulated (e.g. read and written)`, ); }}export class ERR_HTTP2_ORIGIN_LENGTH extends NodeTypeError { constructor() { super( "ERR_HTTP2_ORIGIN_LENGTH", `HTTP/2 ORIGIN frames are limited to 16382 bytes`, ); }}export class ERR_HTTP2_OUT_OF_STREAMS extends NodeError { constructor() { super( "ERR_HTTP2_OUT_OF_STREAMS", `No stream ID is available because maximum stream ID has been reached`, ); }}export class ERR_HTTP2_PAYLOAD_FORBIDDEN extends NodeError { constructor(x: string) { super( "ERR_HTTP2_PAYLOAD_FORBIDDEN", `Responses with ${x} status must not have a payload`, ); }}export class ERR_HTTP2_PING_CANCEL extends NodeError { constructor() { super("ERR_HTTP2_PING_CANCEL", `HTTP2 ping cancelled`); }}export class ERR_HTTP2_PING_LENGTH extends NodeRangeError { constructor() { super("ERR_HTTP2_PING_LENGTH", `HTTP2 ping payload must be 8 bytes`); }}export class ERR_HTTP2_PSEUDOHEADER_NOT_ALLOWED extends NodeTypeError { constructor() { super( "ERR_HTTP2_PSEUDOHEADER_NOT_ALLOWED", `Cannot set HTTP/2 pseudo-headers`, ); }}export class ERR_HTTP2_PUSH_DISABLED extends NodeError { constructor() { super("ERR_HTTP2_PUSH_DISABLED", `HTTP/2 client has disabled push streams`); }}export class ERR_HTTP2_SEND_FILE extends NodeError { constructor() { super("ERR_HTTP2_SEND_FILE", `Directories cannot be sent`); }}export class ERR_HTTP2_SEND_FILE_NOSEEK extends NodeError { constructor() { super( "ERR_HTTP2_SEND_FILE_NOSEEK", `Offset or length can only be specified for regular files`, ); }}export class ERR_HTTP2_SESSION_ERROR extends NodeError { constructor(x: string) { super("ERR_HTTP2_SESSION_ERROR", `Session closed with error code ${x}`); }}export class ERR_HTTP2_SETTINGS_CANCEL extends NodeError { constructor() { super("ERR_HTTP2_SETTINGS_CANCEL", `HTTP2 session settings canceled`); }}export class ERR_HTTP2_SOCKET_BOUND extends NodeError { constructor() { super( "ERR_HTTP2_SOCKET_BOUND", `The socket is already bound to an Http2Session`, ); }}export class ERR_HTTP2_SOCKET_UNBOUND extends NodeError { constructor() { super( "ERR_HTTP2_SOCKET_UNBOUND", `The socket has been disconnected from the Http2Session`, ); }}export class ERR_HTTP2_STATUS_101 extends NodeError { constructor() { super( "ERR_HTTP2_STATUS_101", `HTTP status code 101 (Switching Protocols) is forbidden in HTTP/2`, ); }}export class ERR_HTTP2_STATUS_INVALID extends NodeRangeError { constructor(x: string) { super("ERR_HTTP2_STATUS_INVALID", `Invalid status code: ${x}`); }}export class ERR_HTTP2_STREAM_ERROR extends NodeError { constructor(x: string) { super("ERR_HTTP2_STREAM_ERROR", `Stream closed with error code ${x}`); }}export class ERR_HTTP2_STREAM_SELF_DEPENDENCY extends NodeError { constructor() { super( "ERR_HTTP2_STREAM_SELF_DEPENDENCY", `A stream cannot depend on itself`, ); }}export class ERR_HTTP2_TRAILERS_ALREADY_SENT extends NodeError { constructor() { super( "ERR_HTTP2_TRAILERS_ALREADY_SENT", `Trailing headers have already been sent`, ); }}export class ERR_HTTP2_TRAILERS_NOT_READY extends NodeError { constructor() { super( "ERR_HTTP2_TRAILERS_NOT_READY", `Trailing headers cannot be sent until after the wantTrailers event is emitted`, ); }}export class ERR_HTTP2_UNSUPPORTED_PROTOCOL extends NodeError { constructor(x: string) { super("ERR_HTTP2_UNSUPPORTED_PROTOCOL", `protocol "${x}" is unsupported.`); }}export class ERR_HTTP_HEADERS_SENT extends NodeError { constructor(x: string) { super( "ERR_HTTP_HEADERS_SENT", `Cannot ${x} headers after they are sent to the client`, ); }}export class ERR_HTTP_INVALID_HEADER_VALUE extends NodeTypeError { constructor(x: string, y: string) { super( "ERR_HTTP_INVALID_HEADER_VALUE", `Invalid value "${x}" for header "${y}"`, ); }}export class ERR_HTTP_INVALID_STATUS_CODE extends NodeRangeError { constructor(x: string) { super("ERR_HTTP_INVALID_STATUS_CODE", `Invalid status code: ${x}`); }}export class ERR_HTTP_SOCKET_ENCODING extends NodeError { constructor() { super( "ERR_HTTP_SOCKET_ENCODING", `Changing the socket encoding is not allowed per RFC7230 Section 3.`, ); }}export class ERR_HTTP_TRAILER_INVALID extends NodeError { constructor() { super( "ERR_HTTP_TRAILER_INVALID", `Trailers are invalid with this transfer encoding`, ); }}export class ERR_INCOMPATIBLE_OPTION_PAIR extends NodeTypeError { constructor(x: string, y: string) { super( "ERR_INCOMPATIBLE_OPTION_PAIR", `Option "${x}" cannot be used in combination with option "${y}"`, ); }}export class ERR_INPUT_TYPE_NOT_ALLOWED extends NodeError { constructor() { super( "ERR_INPUT_TYPE_NOT_ALLOWED", `--input-type can only be used with string input via --eval, --print, or STDIN`, ); }}export class ERR_INSPECTOR_ALREADY_ACTIVATED extends NodeError { constructor() { super( "ERR_INSPECTOR_ALREADY_ACTIVATED", `Inspector is already activated. Close it with inspector.close() before activating it again.`, ); }}export class ERR_INSPECTOR_ALREADY_CONNECTED extends NodeError { constructor(x: string) { super("ERR_INSPECTOR_ALREADY_CONNECTED", `${x} is already connected`); }}export class ERR_INSPECTOR_CLOSED extends NodeError { constructor() { super("ERR_INSPECTOR_CLOSED", `Session was closed`); }}export class ERR_INSPECTOR_COMMAND extends NodeError { constructor(x: number, y: string) { super("ERR_INSPECTOR_COMMAND", `Inspector error ${x}: ${y}`); }}export class ERR_INSPECTOR_NOT_ACTIVE extends NodeError { constructor() { super("ERR_INSPECTOR_NOT_ACTIVE", `Inspector is not active`); }}export class ERR_INSPECTOR_NOT_AVAILABLE extends NodeError { constructor() { super("ERR_INSPECTOR_NOT_AVAILABLE", `Inspector is not available`); }}export class ERR_INSPECTOR_NOT_CONNECTED extends NodeError { constructor() { super("ERR_INSPECTOR_NOT_CONNECTED", `Session is not connected`); }}export class ERR_INSPECTOR_NOT_WORKER extends NodeError { constructor() { super("ERR_INSPECTOR_NOT_WORKER", `Current thread is not a worker`); }}export class ERR_INVALID_ASYNC_ID extends NodeRangeError { constructor(x: string, y: string | number) { super("ERR_INVALID_ASYNC_ID", `Invalid ${x} value: ${y}`); }}export class ERR_INVALID_BUFFER_SIZE extends NodeRangeError { constructor(x: string) { super("ERR_INVALID_BUFFER_SIZE", `Buffer size must be a multiple of ${x}`); }}export class ERR_INVALID_CURSOR_POS extends NodeTypeError { constructor() { super( "ERR_INVALID_CURSOR_POS", `Cannot set cursor row without setting its column`, ); }}export class ERR_INVALID_FD extends NodeRangeError { constructor(x: string) { super("ERR_INVALID_FD", `"fd" must be a positive integer: ${x}`); }}export class ERR_INVALID_FD_TYPE extends NodeTypeError { constructor(x: string) { super("ERR_INVALID_FD_TYPE", `Unsupported fd type: ${x}`); }}export class ERR_INVALID_FILE_URL_HOST extends NodeTypeError { constructor(x: string) { super( "ERR_INVALID_FILE_URL_HOST", `File URL host must be "localhost" or empty on ${x}`, ); }}export class ERR_INVALID_FILE_URL_PATH extends NodeTypeError { constructor(x: string) { super("ERR_INVALID_FILE_URL_PATH", `File URL path ${x}`); }}export class ERR_INVALID_HANDLE_TYPE extends NodeTypeError { constructor() { super("ERR_INVALID_HANDLE_TYPE", `This handle type cannot be sent`); }}export class ERR_INVALID_HTTP_TOKEN extends NodeTypeError { constructor(x: string, y: string) { super("ERR_INVALID_HTTP_TOKEN", `${x} must be a valid HTTP token ["${y}"]`); }}export class ERR_INVALID_IP_ADDRESS extends NodeTypeError { constructor(x: string) { super("ERR_INVALID_IP_ADDRESS", `Invalid IP address: ${x}`); }}export class ERR_INVALID_OPT_VALUE_ENCODING extends NodeTypeError { constructor(x: string) { super( "ERR_INVALID_OPT_VALUE_ENCODING", `The value "${x}" is invalid for option "encoding"`, ); }}export class ERR_INVALID_PERFORMANCE_MARK extends NodeError { constructor(x: string) { super( "ERR_INVALID_PERFORMANCE_MARK", `The "${x}" performance mark has not been set`, ); }}export class ERR_INVALID_PROTOCOL extends NodeTypeError { constructor(x: string, y: string) { super( "ERR_INVALID_PROTOCOL", `Protocol "${x}" not supported. Expected "${y}"`, ); }}export class ERR_INVALID_REPL_EVAL_CONFIG extends NodeTypeError { constructor() { super( "ERR_INVALID_REPL_EVAL_CONFIG", `Cannot specify both "breakEvalOnSigint" and "eval" for REPL`, ); }}export class ERR_INVALID_REPL_INPUT extends NodeTypeError { constructor(x: string) { super("ERR_INVALID_REPL_INPUT", `${x}`); }}export class ERR_INVALID_SYNC_FORK_INPUT extends NodeTypeError { constructor(x: string) { super( "ERR_INVALID_SYNC_FORK_INPUT", `Asynchronous forks do not support Buffer, TypedArray, DataView or string input: ${x}`, ); }}export class ERR_INVALID_THIS extends NodeTypeError { constructor(x: string) { super("ERR_INVALID_THIS", `Value of "this" must be of type ${x}`); }}export class ERR_INVALID_TUPLE extends NodeTypeError { constructor(x: string, y: string) { super("ERR_INVALID_TUPLE", `${x} must be an iterable ${y} tuple`); }}export class ERR_INVALID_URI extends NodeURIError { constructor() { super("ERR_INVALID_URI", `URI malformed`); }}export class ERR_IPC_CHANNEL_CLOSED extends NodeError { constructor() { super("ERR_IPC_CHANNEL_CLOSED", `Channel closed`); }}export class ERR_IPC_DISCONNECTED extends NodeError { constructor() { super("ERR_IPC_DISCONNECTED", `IPC channel is already disconnected`); }}export class ERR_IPC_ONE_PIPE extends NodeError { constructor() { super("ERR_IPC_ONE_PIPE", `Child process can have only one IPC pipe`); }}export class ERR_IPC_SYNC_FORK extends NodeError { constructor() { super("ERR_IPC_SYNC_FORK", `IPC cannot be used with synchronous forks`); }}export class ERR_MANIFEST_DEPENDENCY_MISSING extends NodeError { constructor(x: string, y: string) { super( "ERR_MANIFEST_DEPENDENCY_MISSING", `Manifest resource ${x} does not list ${y} as a dependency specifier`, ); }}export class ERR_MANIFEST_INTEGRITY_MISMATCH extends NodeSyntaxError { constructor(x: string) { super( "ERR_MANIFEST_INTEGRITY_MISMATCH", `Manifest resource ${x} has multiple entries but integrity lists do not match`, ); }}export class ERR_MANIFEST_INVALID_RESOURCE_FIELD extends NodeTypeError { constructor(x: string, y: string) { super( "ERR_MANIFEST_INVALID_RESOURCE_FIELD", `Manifest resource ${x} has invalid property value for ${y}`, ); }}export class ERR_MANIFEST_TDZ extends NodeError { constructor() { super("ERR_MANIFEST_TDZ", `Manifest initialization has not yet run`); }}export class ERR_MANIFEST_UNKNOWN_ONERROR extends NodeSyntaxError { constructor(x: string) { super( "ERR_MANIFEST_UNKNOWN_ONERROR", `Manifest specified unknown error behavior "${x}".`, ); }}export class ERR_METHOD_NOT_IMPLEMENTED extends NodeError { constructor(x: string) { super("ERR_METHOD_NOT_IMPLEMENTED", `The ${x} method is not implemented`); }}export class ERR_MISSING_ARGS extends NodeTypeError { constructor(...args: (string | string[])[]) { let msg = "The ";
const len = args.length;
const wrap = (a: unknown) => `"${a}"`;
args = args.map((a) => Array.isArray(a) ? a.map(wrap).join(" or ") : wrap(a) );
switch (len) { case 1: msg += `${args[0]} argument`; break; case 2: msg += `${args[0]} and ${args[1]} arguments`; break; default: msg += args.slice(0, len - 1).join(", "); msg += `, and ${args[len - 1]} arguments`; break; }
super("ERR_MISSING_ARGS", `${msg} must be specified`); }}export class ERR_MISSING_OPTION extends NodeTypeError { constructor(x: string) { super("ERR_MISSING_OPTION", `${x} is required`); }}export class ERR_MULTIPLE_CALLBACK extends NodeError { constructor() { super("ERR_MULTIPLE_CALLBACK", `Callback called multiple times`); }}export class ERR_NAPI_CONS_FUNCTION extends NodeTypeError { constructor() { super("ERR_NAPI_CONS_FUNCTION", `Constructor must be a function`); }}export class ERR_NAPI_INVALID_DATAVIEW_ARGS extends NodeRangeError { constructor() { super( "ERR_NAPI_INVALID_DATAVIEW_ARGS", `byte_offset + byte_length should be less than or equal to the size in bytes of the array passed in`, ); }}export class ERR_NAPI_INVALID_TYPEDARRAY_ALIGNMENT extends NodeRangeError { constructor(x: string, y: string) { super( "ERR_NAPI_INVALID_TYPEDARRAY_ALIGNMENT", `start offset of ${x} should be a multiple of ${y}`, ); }}export class ERR_NAPI_INVALID_TYPEDARRAY_LENGTH extends NodeRangeError { constructor() { super("ERR_NAPI_INVALID_TYPEDARRAY_LENGTH", `Invalid typed array length`); }}export class ERR_NO_CRYPTO extends NodeError { constructor() { super( "ERR_NO_CRYPTO", `Node.js is not compiled with OpenSSL crypto support`, ); }}export class ERR_NO_ICU extends NodeTypeError { constructor(x: string) { super( "ERR_NO_ICU", `${x} is not supported on Node.js compiled without ICU`, ); }}export class ERR_QUICCLIENTSESSION_FAILED extends NodeError { constructor(x: string) { super( "ERR_QUICCLIENTSESSION_FAILED", `Failed to create a new QuicClientSession: ${x}`, ); }}export class ERR_QUICCLIENTSESSION_FAILED_SETSOCKET extends NodeError { constructor() { super( "ERR_QUICCLIENTSESSION_FAILED_SETSOCKET", `Failed to set the QuicSocket`, ); }}export class ERR_QUICSESSION_DESTROYED extends NodeError { constructor(x: string) { super( "ERR_QUICSESSION_DESTROYED", `Cannot call ${x} after a QuicSession has been destroyed`, ); }}export class ERR_QUICSESSION_INVALID_DCID extends NodeError { constructor(x: string) { super("ERR_QUICSESSION_INVALID_DCID", `Invalid DCID value: ${x}`); }}export class ERR_QUICSESSION_UPDATEKEY extends NodeError { constructor() { super("ERR_QUICSESSION_UPDATEKEY", `Unable to update QuicSession keys`); }}export class ERR_QUICSOCKET_DESTROYED extends NodeError { constructor(x: string) { super( "ERR_QUICSOCKET_DESTROYED", `Cannot call ${x} after a QuicSocket has been destroyed`, ); }}export class ERR_QUICSOCKET_INVALID_STATELESS_RESET_SECRET_LENGTH extends NodeError { constructor() { super( "ERR_QUICSOCKET_INVALID_STATELESS_RESET_SECRET_LENGTH", `The stateResetToken must be exactly 16-bytes in length`, ); }}export class ERR_QUICSOCKET_LISTENING extends NodeError { constructor() { super("ERR_QUICSOCKET_LISTENING", `This QuicSocket is already listening`); }}export class ERR_QUICSOCKET_UNBOUND extends NodeError { constructor(x: string) { super( "ERR_QUICSOCKET_UNBOUND", `Cannot call ${x} before a QuicSocket has been bound`, ); }}export class ERR_QUICSTREAM_DESTROYED extends NodeError { constructor(x: string) { super( "ERR_QUICSTREAM_DESTROYED", `Cannot call ${x} after a QuicStream has been destroyed`, ); }}export class ERR_QUICSTREAM_INVALID_PUSH extends NodeError { constructor() { super( "ERR_QUICSTREAM_INVALID_PUSH", `Push streams are only supported on client-initiated, bidirectional streams`, ); }}export class ERR_QUICSTREAM_OPEN_FAILED extends NodeError { constructor() { super("ERR_QUICSTREAM_OPEN_FAILED", `Opening a new QuicStream failed`); }}export class ERR_QUICSTREAM_UNSUPPORTED_PUSH extends NodeError { constructor() { super( "ERR_QUICSTREAM_UNSUPPORTED_PUSH", `Push streams are not supported on this QuicSession`, ); }}export class ERR_QUIC_TLS13_REQUIRED extends NodeError { constructor() { super("ERR_QUIC_TLS13_REQUIRED", `QUIC requires TLS version 1.3`); }}export class ERR_SCRIPT_EXECUTION_INTERRUPTED extends NodeError { constructor() { super( "ERR_SCRIPT_EXECUTION_INTERRUPTED", "Script execution was interrupted by `SIGINT`", ); }}export class ERR_SERVER_ALREADY_LISTEN extends NodeError { constructor() { super( "ERR_SERVER_ALREADY_LISTEN", `Listen method has been called more than once without closing.`, ); }}export class ERR_SERVER_NOT_RUNNING extends NodeError { constructor() { super("ERR_SERVER_NOT_RUNNING", `Server is not running.`); }}export class ERR_SOCKET_ALREADY_BOUND extends NodeError { constructor() { super("ERR_SOCKET_ALREADY_BOUND", `Socket is already bound`); }}export class ERR_SOCKET_BAD_BUFFER_SIZE extends NodeTypeError { constructor() { super( "ERR_SOCKET_BAD_BUFFER_SIZE", `Buffer size must be a positive integer`, ); }}export class ERR_SOCKET_BAD_PORT extends NodeRangeError { constructor(name: string, port: unknown, allowZero = true) { assert( typeof allowZero === "boolean", "The 'allowZero' argument must be of type boolean.", );
const operator = allowZero ? ">=" : ">";
super( "ERR_SOCKET_BAD_PORT", `${name} should be ${operator} 0 and < 65536. Received ${port}.`, ); }}export class ERR_SOCKET_BAD_TYPE extends NodeTypeError { constructor() { super( "ERR_SOCKET_BAD_TYPE", `Bad socket type specified. Valid types are: udp4, udp6`, ); }}export class ERR_SOCKET_BUFFER_SIZE extends NodeSystemError { constructor(ctx: NodeSystemErrorCtx) { super("ERR_SOCKET_BUFFER_SIZE", ctx, "Could not get or set buffer size"); }}export class ERR_SOCKET_CLOSED extends NodeError { constructor() { super("ERR_SOCKET_CLOSED", `Socket is closed`); }}export class ERR_SOCKET_DGRAM_IS_CONNECTED extends NodeError { constructor() { super("ERR_SOCKET_DGRAM_IS_CONNECTED", `Already connected`); }}export class ERR_SOCKET_DGRAM_NOT_CONNECTED extends NodeError { constructor() { super("ERR_SOCKET_DGRAM_NOT_CONNECTED", `Not connected`); }}export class ERR_SOCKET_DGRAM_NOT_RUNNING extends NodeError { constructor() { super("ERR_SOCKET_DGRAM_NOT_RUNNING", `Not running`); }}export class ERR_SRI_PARSE extends NodeSyntaxError { constructor(name: string, char: string, position: number) { super( "ERR_SRI_PARSE", `Subresource Integrity string ${name} had an unexpected ${char} at position ${position}`, ); }}export class ERR_STREAM_ALREADY_FINISHED extends NodeError { constructor(x: string) { super( "ERR_STREAM_ALREADY_FINISHED", `Cannot call ${x} after a stream was finished`, ); }}export class ERR_STREAM_CANNOT_PIPE extends NodeError { constructor() { super("ERR_STREAM_CANNOT_PIPE", `Cannot pipe, not readable`); }}export class ERR_STREAM_DESTROYED extends NodeError { constructor(x: string) { super( "ERR_STREAM_DESTROYED", `Cannot call ${x} after a stream was destroyed`, ); }}export class ERR_STREAM_NULL_VALUES extends NodeTypeError { constructor() { super("ERR_STREAM_NULL_VALUES", `May not write null values to stream`); }}export class ERR_STREAM_PREMATURE_CLOSE extends NodeError { constructor() { super("ERR_STREAM_PREMATURE_CLOSE", `Premature close`); }}export class ERR_STREAM_PUSH_AFTER_EOF extends NodeError { constructor() { super("ERR_STREAM_PUSH_AFTER_EOF", `stream.push() after EOF`); }}export class ERR_STREAM_UNSHIFT_AFTER_END_EVENT extends NodeError { constructor() { super( "ERR_STREAM_UNSHIFT_AFTER_END_EVENT", `stream.unshift() after end event`, ); }}export class ERR_STREAM_WRAP extends NodeError { constructor() { super( "ERR_STREAM_WRAP", `Stream has StringDecoder set or is in objectMode`, ); }}export class ERR_STREAM_WRITE_AFTER_END extends NodeError { constructor() { super("ERR_STREAM_WRITE_AFTER_END", `write after end`); }}export class ERR_SYNTHETIC extends NodeError { constructor() { super("ERR_SYNTHETIC", `JavaScript Callstack`); }}export class ERR_TLS_CERT_ALTNAME_INVALID extends NodeError { reason: string; host: string; cert: string;
constructor(reason: string, host: string, cert: string) { super( "ERR_TLS_CERT_ALTNAME_INVALID", `Hostname/IP does not match certificate's altnames: ${reason}`, ); this.reason = reason; this.host = host; this.cert = cert; }}export class ERR_TLS_DH_PARAM_SIZE extends NodeError { constructor(x: string) { super("ERR_TLS_DH_PARAM_SIZE", `DH parameter size ${x} is less than 2048`); }}export class ERR_TLS_HANDSHAKE_TIMEOUT extends NodeError { constructor() { super("ERR_TLS_HANDSHAKE_TIMEOUT", `TLS handshake timeout`); }}export class ERR_TLS_INVALID_CONTEXT extends NodeTypeError { constructor(x: string) { super("ERR_TLS_INVALID_CONTEXT", `${x} must be a SecureContext`); }}export class ERR_TLS_INVALID_STATE extends NodeError { constructor() { super( "ERR_TLS_INVALID_STATE", `TLS socket connection must be securely established`, ); }}export class ERR_TLS_INVALID_PROTOCOL_VERSION extends NodeTypeError { constructor(protocol: string, x: string) { super( "ERR_TLS_INVALID_PROTOCOL_VERSION", `${protocol} is not a valid ${x} TLS protocol version`, ); }}export class ERR_TLS_PROTOCOL_VERSION_CONFLICT extends NodeTypeError { constructor(prevProtocol: string, protocol: string) { super( "ERR_TLS_PROTOCOL_VERSION_CONFLICT", `TLS protocol version ${prevProtocol} conflicts with secureProtocol ${protocol}`, ); }}export class ERR_TLS_RENEGOTIATION_DISABLED extends NodeError { constructor() { super( "ERR_TLS_RENEGOTIATION_DISABLED", `TLS session renegotiation disabled for this socket`, ); }}export class ERR_TLS_REQUIRED_SERVER_NAME extends NodeError { constructor() { super( "ERR_TLS_REQUIRED_SERVER_NAME", `"servername" is required parameter for Server.addContext`, ); }}export class ERR_TLS_SESSION_ATTACK extends NodeError { constructor() { super( "ERR_TLS_SESSION_ATTACK", `TLS session renegotiation attack detected`, ); }}export class ERR_TLS_SNI_FROM_SERVER extends NodeError { constructor() { super( "ERR_TLS_SNI_FROM_SERVER", `Cannot issue SNI from a TLS server-side socket`, ); }}export class ERR_TRACE_EVENTS_CATEGORY_REQUIRED extends NodeTypeError { constructor() { super( "ERR_TRACE_EVENTS_CATEGORY_REQUIRED", `At least one category is required`, ); }}export class ERR_TRACE_EVENTS_UNAVAILABLE extends NodeError { constructor() { super("ERR_TRACE_EVENTS_UNAVAILABLE", `Trace events are unavailable`); }}export class ERR_UNAVAILABLE_DURING_EXIT extends NodeError { constructor() { super( "ERR_UNAVAILABLE_DURING_EXIT", `Cannot call function in process exit handler`, ); }}export class ERR_UNCAUGHT_EXCEPTION_CAPTURE_ALREADY_SET extends NodeError { constructor() { super( "ERR_UNCAUGHT_EXCEPTION_CAPTURE_ALREADY_SET", "`process.setupUncaughtExceptionCapture()` was called while a capture callback was already active", ); }}export class ERR_UNESCAPED_CHARACTERS extends NodeTypeError { constructor(x: string) { super("ERR_UNESCAPED_CHARACTERS", `${x} contains unescaped characters`); }}export class ERR_UNHANDLED_ERROR extends NodeError { constructor(x: string) { super("ERR_UNHANDLED_ERROR", `Unhandled error. (${x})`); }}export class ERR_UNKNOWN_BUILTIN_MODULE extends NodeError { constructor(x: string) { super("ERR_UNKNOWN_BUILTIN_MODULE", `No such built-in module: ${x}`); }}export class ERR_UNKNOWN_CREDENTIAL extends NodeError { constructor(x: string, y: string) { super("ERR_UNKNOWN_CREDENTIAL", `${x} identifier does not exist: ${y}`); }}export class ERR_UNKNOWN_ENCODING extends NodeTypeError { constructor(x: string) { super("ERR_UNKNOWN_ENCODING", `Unknown encoding: ${x}`); }}export class ERR_UNKNOWN_FILE_EXTENSION extends NodeTypeError { constructor(x: string, y: string) { super( "ERR_UNKNOWN_FILE_EXTENSION", `Unknown file extension "${x}" for ${y}`, ); }}export class ERR_UNKNOWN_MODULE_FORMAT extends NodeRangeError { constructor(x: string) { super("ERR_UNKNOWN_MODULE_FORMAT", `Unknown module format: ${x}`); }}export class ERR_UNKNOWN_SIGNAL extends NodeTypeError { constructor(x: string) { super("ERR_UNKNOWN_SIGNAL", `Unknown signal: ${x}`); }}export class ERR_UNSUPPORTED_DIR_IMPORT extends NodeError { constructor(x: string, y: string) { super( "ERR_UNSUPPORTED_DIR_IMPORT", `Directory import '${x}' is not supported resolving ES modules, imported from ${y}`, ); }}export class ERR_UNSUPPORTED_ESM_URL_SCHEME extends NodeError { constructor() { super( "ERR_UNSUPPORTED_ESM_URL_SCHEME", `Only file and data URLs are supported by the default ESM loader`, ); }}export class ERR_USE_AFTER_CLOSE extends NodeError { constructor(x: string) { super( "ERR_USE_AFTER_CLOSE", `${x} was closed`, ); }}export class ERR_V8BREAKITERATOR extends NodeError { constructor() { super( "ERR_V8BREAKITERATOR", `Full ICU data not installed. See https://github.com/nodejs/node/wiki/Intl`, ); }}export class ERR_VALID_PERFORMANCE_ENTRY_TYPE extends NodeError { constructor() { super( "ERR_VALID_PERFORMANCE_ENTRY_TYPE", `At least one valid performance entry type is required`, ); }}export class ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING extends NodeTypeError { constructor() { super( "ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING", `A dynamic import callback was not specified.`, ); }}export class ERR_VM_MODULE_ALREADY_LINKED extends NodeError { constructor() { super("ERR_VM_MODULE_ALREADY_LINKED", `Module has already been linked`); }}export class ERR_VM_MODULE_CANNOT_CREATE_CACHED_DATA extends NodeError { constructor() { super( "ERR_VM_MODULE_CANNOT_CREATE_CACHED_DATA", `Cached data cannot be created for a module which has been evaluated`, ); }}export class ERR_VM_MODULE_DIFFERENT_CONTEXT extends NodeError { constructor() { super( "ERR_VM_MODULE_DIFFERENT_CONTEXT", `Linked modules must use the same context`, ); }}export class ERR_VM_MODULE_LINKING_ERRORED extends NodeError { constructor() { super( "ERR_VM_MODULE_LINKING_ERRORED", `Linking has already failed for the provided module`, ); }}export class ERR_VM_MODULE_NOT_MODULE extends NodeError { constructor() { super( "ERR_VM_MODULE_NOT_MODULE", `Provided module is not an instance of Module`, ); }}export class ERR_VM_MODULE_STATUS extends NodeError { constructor(x: string) { super("ERR_VM_MODULE_STATUS", `Module status ${x}`); }}export class ERR_WASI_ALREADY_STARTED extends NodeError { constructor() { super("ERR_WASI_ALREADY_STARTED", `WASI instance has already started`); }}export class ERR_WORKER_INIT_FAILED extends NodeError { constructor(x: string) { super("ERR_WORKER_INIT_FAILED", `Worker initialization failure: ${x}`); }}export class ERR_WORKER_NOT_RUNNING extends NodeError { constructor() { super("ERR_WORKER_NOT_RUNNING", `Worker instance not running`); }}export class ERR_WORKER_OUT_OF_MEMORY extends NodeError { constructor(x: string) { super( "ERR_WORKER_OUT_OF_MEMORY", `Worker terminated due to reaching memory limit: ${x}`, ); }}export class ERR_WORKER_UNSERIALIZABLE_ERROR extends NodeError { constructor() { super( "ERR_WORKER_UNSERIALIZABLE_ERROR", `Serializing an uncaught exception failed`, ); }}export class ERR_WORKER_UNSUPPORTED_EXTENSION extends NodeTypeError { constructor(x: string) { super( "ERR_WORKER_UNSUPPORTED_EXTENSION", `The worker script extension must be ".js", ".mjs", or ".cjs". Received "${x}"`, ); }}export class ERR_WORKER_UNSUPPORTED_OPERATION extends NodeTypeError { constructor(x: string) { super( "ERR_WORKER_UNSUPPORTED_OPERATION", `${x} is not supported in workers`, ); }}export class ERR_ZLIB_INITIALIZATION_FAILED extends NodeError { constructor() { super("ERR_ZLIB_INITIALIZATION_FAILED", `Initialization failed`); }}export class ERR_FALSY_VALUE_REJECTION extends NodeError { reason: string; constructor(reason: string) { super("ERR_FALSY_VALUE_REJECTION", "Promise was rejected with falsy value"); this.reason = reason; }}export class ERR_HTTP2_INVALID_SETTING_VALUE extends NodeRangeError { actual: unknown; min?: number; max?: number;
constructor(name: string, actual: unknown, min?: number, max?: number) { super( "ERR_HTTP2_INVALID_SETTING_VALUE", `Invalid value for setting "${name}": ${actual}`, ); this.actual = actual; if (min !== undefined) { this.min = min; this.max = max; } }}export class ERR_HTTP2_STREAM_CANCEL extends NodeError { override cause?: Error; constructor(error: Error) { super( "ERR_HTTP2_STREAM_CANCEL", typeof error.message === "string" ? `The pending stream has been canceled (caused by: ${error.message})` : "The pending stream has been canceled", ); if (error) { this.cause = error; } }}
export class ERR_INVALID_ADDRESS_FAMILY extends NodeRangeError { host: string; port: number; constructor(addressType: string, host: string, port: number) { super( "ERR_INVALID_ADDRESS_FAMILY", `Invalid address family: ${addressType} ${host}:${port}`, ); this.host = host; this.port = port; }}
export class ERR_INVALID_CHAR extends NodeTypeError { constructor(name: string, field?: string) { super( "ERR_INVALID_CHAR", field ? `Invalid character in ${name}` : `Invalid character in ${name} ["${field}"]`, ); }}
export class ERR_INVALID_OPT_VALUE extends NodeTypeError { constructor(name: string, value: unknown) { super( "ERR_INVALID_OPT_VALUE", `The value "${value}" is invalid for option "${name}"`, ); }}
export class ERR_INVALID_RETURN_PROPERTY extends NodeTypeError { constructor(input: string, name: string, prop: string, value: string) { super( "ERR_INVALID_RETURN_PROPERTY", `Expected a valid ${input} to be returned for the "${prop}" from the "${name}" function but got ${value}.`, ); }}
// deno-lint-ignore no-explicit-anyfunction buildReturnPropertyType(value: any) { if (value && value.constructor && value.constructor.name) { return `instance of ${value.constructor.name}`; } else { return `type ${typeof value}`; }}
export class ERR_INVALID_RETURN_PROPERTY_VALUE extends NodeTypeError { constructor(input: string, name: string, prop: string, value: unknown) { super( "ERR_INVALID_RETURN_PROPERTY_VALUE", `Expected ${input} to be returned for the "${prop}" from the "${name}" function but got ${ buildReturnPropertyType( value, ) }.`, ); }}
export class ERR_INVALID_RETURN_VALUE extends NodeTypeError { constructor(input: string, name: string, value: unknown) { super( "ERR_INVALID_RETURN_VALUE", `Expected ${input} to be returned from the "${name}" function but got ${ determineSpecificType( value, ) }.`, ); }}
export class ERR_INVALID_URL extends NodeTypeError { input: string; constructor(input: string) { super("ERR_INVALID_URL", `Invalid URL: ${input}`); this.input = input; }}
export class ERR_INVALID_URL_SCHEME extends NodeTypeError { constructor(expected: string | [string] | [string, string]) { expected = Array.isArray(expected) ? expected : [expected]; const res = expected.length === 2 ? `one of scheme ${expected[0]} or ${expected[1]}` : `of scheme ${expected[0]}`; super("ERR_INVALID_URL_SCHEME", `The URL must be ${res}`); }}
export class ERR_MODULE_NOT_FOUND extends NodeError { constructor(path: string, base: string, type: string = "package") { super( "ERR_MODULE_NOT_FOUND", `Cannot find ${type} '${path}' imported from ${base}`, ); }}
export class ERR_INVALID_PACKAGE_CONFIG extends NodeError { constructor(path: string, base?: string, message?: string) { const msg = `Invalid package config ${path}${ base ? ` while importing ${base}` : "" }${message ? `. ${message}` : ""}`; super("ERR_INVALID_PACKAGE_CONFIG", msg); }}
export class ERR_INVALID_MODULE_SPECIFIER extends NodeTypeError { constructor(request: string, reason: string, base?: string) { super( "ERR_INVALID_MODULE_SPECIFIER", `Invalid module "${request}" ${reason}${ base ? ` imported from ${base}` : "" }`, ); }}
export class ERR_INVALID_PACKAGE_TARGET extends NodeError { constructor( pkgPath: string, key: string, // deno-lint-ignore no-explicit-any target: any, isImport?: boolean, base?: string, ) { let msg: string; const relError = typeof target === "string" && !isImport && target.length && !target.startsWith("./"); if (key === ".") { assert(isImport === false); msg = `Invalid "exports" main target ${JSON.stringify(target)} defined ` + `in the package config ${pkgPath}package.json${ base ? ` imported from ${base}` : "" }${relError ? '; targets must start with "./"' : ""}`; } else { msg = `Invalid "${isImport ? "imports" : "exports"}" target ${ JSON.stringify( target, ) } defined for '${key}' in the package config ${pkgPath}package.json${ base ? ` imported from ${base}` : "" }${relError ? '; targets must start with "./"' : ""}`; } super("ERR_INVALID_PACKAGE_TARGET", msg); }}
export class ERR_PACKAGE_IMPORT_NOT_DEFINED extends NodeTypeError { constructor( specifier: string, packagePath: string | undefined, base: string, ) { const msg = `Package import specifier "${specifier}" is not defined${ packagePath ? ` in package ${packagePath}package.json` : "" } imported from ${base}`;
super("ERR_PACKAGE_IMPORT_NOT_DEFINED", msg); }}
export class ERR_PACKAGE_PATH_NOT_EXPORTED extends NodeError { constructor(subpath: string, pkgPath: string, basePath?: string) { let msg: string; if (subpath === ".") { msg = `No "exports" main defined in ${pkgPath}package.json${ basePath ? ` imported from ${basePath}` : "" }`; } else { msg = `Package subpath '${subpath}' is not defined by "exports" in ${pkgPath}package.json${ basePath ? ` imported from ${basePath}` : "" }`; }
super("ERR_PACKAGE_PATH_NOT_EXPORTED", msg); }}
export class ERR_INTERNAL_ASSERTION extends NodeError { constructor(message?: string) { const suffix = "This is caused by either a bug in Node.js " + "or incorrect usage of Node.js internals.\n" + "Please open an issue with this stack trace at " + "https://github.com/nodejs/node/issues\n"; super( "ERR_INTERNAL_ASSERTION", message === undefined ? suffix : `${message}\n${suffix}`, ); }}
// Using `fs.rmdir` on a path that is a file results in an ENOENT error on Windows and an ENOTDIR error on POSIX.export class ERR_FS_RMDIR_ENOTDIR extends NodeSystemError { constructor(path: string) { const code = isWindows ? "ENOENT" : "ENOTDIR"; const ctx: NodeSystemErrorCtx = { message: "not a directory", path, syscall: "rmdir", code, errno: isWindows ? ENOENT : ENOTDIR, }; super(code, ctx, "Path is not a directory"); }}
interface UvExceptionContext { syscall: string; path?: string;}export function denoErrorToNodeError(e: Error, ctx: UvExceptionContext) { const errno = extractOsErrorNumberFromErrorMessage(e); if (typeof errno === "undefined") { return e; }
const ex = uvException({ errno: mapSysErrnoToUvErrno(errno), ...ctx, }); return ex;}
function extractOsErrorNumberFromErrorMessage(e: unknown): number | undefined { const match = e instanceof Error ? e.message.match(/\(os error (\d+)\)/) : false;
if (match) { return +match[1]; }
return undefined;}
export function connResetException(msg: string) { const ex = new Error(msg); // deno-lint-ignore no-explicit-any (ex as any).code = "ECONNRESET"; return ex;}
export function aggregateTwoErrors( innerError: AggregateError, outerError: AggregateError & { code: string },) { if (innerError && outerError && innerError !== outerError) { if (Array.isArray(outerError.errors)) { // If `outerError` is already an `AggregateError`. outerError.errors.push(innerError); return outerError; } // eslint-disable-next-line no-restricted-syntax const err = new AggregateError( [ outerError, innerError, ], outerError.message, ); // deno-lint-ignore no-explicit-any (err as any).code = outerError.code; return err; } return innerError || outerError;}codes.ERR_IPC_CHANNEL_CLOSED = ERR_IPC_CHANNEL_CLOSED;codes.ERR_INVALID_ARG_TYPE = ERR_INVALID_ARG_TYPE;codes.ERR_INVALID_ARG_VALUE = ERR_INVALID_ARG_VALUE;codes.ERR_OUT_OF_RANGE = ERR_OUT_OF_RANGE;codes.ERR_SOCKET_BAD_PORT = ERR_SOCKET_BAD_PORT;codes.ERR_BUFFER_OUT_OF_BOUNDS = ERR_BUFFER_OUT_OF_BOUNDS;codes.ERR_UNKNOWN_ENCODING = ERR_UNKNOWN_ENCODING;// TODO(kt3k): assign all error classes here.
/** * This creates a generic Node.js error. * * @param message The error message. * @param errorProperties Object with additional properties to be added to the error. * @returns */const genericNodeError = hideStackFrames( function genericNodeError(message, errorProperties) { // eslint-disable-next-line no-restricted-syntax const err = new Error(message); Object.assign(err, errorProperties);
return err; },);
/** * Determine the specific type of a value for type-mismatch errors. * @param {*} value * @returns {string} */// deno-lint-ignore no-explicit-anyfunction determineSpecificType(value: any) { if (value == null) { return "" + value; } if (typeof value === "function" && value.name) { return `function ${value.name}`; } if (typeof value === "object") { if (value.constructor?.name) { return `an instance of ${value.constructor.name}`; } return `${inspect(value, { depth: -1 })}`; } let inspected = inspect(value, { colors: false }); if (inspected.length > 28) inspected = `${inspected.slice(0, 25)}...`;
return `type ${typeof value} (${inspected})`;}
export { codes, genericNodeError, hideStackFrames };
export default { AbortError, ERR_AMBIGUOUS_ARGUMENT, ERR_ARG_NOT_ITERABLE, ERR_ASSERTION, ERR_ASYNC_CALLBACK, ERR_ASYNC_TYPE, ERR_BROTLI_INVALID_PARAM, ERR_BUFFER_OUT_OF_BOUNDS, ERR_BUFFER_TOO_LARGE, ERR_CANNOT_WATCH_SIGINT, ERR_CHILD_CLOSED_BEFORE_REPLY, ERR_CHILD_PROCESS_IPC_REQUIRED, ERR_CHILD_PROCESS_STDIO_MAXBUFFER, ERR_CONSOLE_WRITABLE_STREAM, ERR_CONTEXT_NOT_INITIALIZED, ERR_CPU_USAGE, ERR_CRYPTO_CUSTOM_ENGINE_NOT_SUPPORTED, ERR_CRYPTO_ECDH_INVALID_FORMAT, ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY, ERR_CRYPTO_ENGINE_UNKNOWN, ERR_CRYPTO_FIPS_FORCED, ERR_CRYPTO_FIPS_UNAVAILABLE, ERR_CRYPTO_HASH_FINALIZED, ERR_CRYPTO_HASH_UPDATE_FAILED, ERR_CRYPTO_INCOMPATIBLE_KEY, ERR_CRYPTO_INCOMPATIBLE_KEY_OPTIONS, ERR_CRYPTO_INVALID_DIGEST, ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE, ERR_CRYPTO_INVALID_STATE, ERR_CRYPTO_PBKDF2_ERROR, ERR_CRYPTO_SCRYPT_INVALID_PARAMETER, ERR_CRYPTO_SCRYPT_NOT_SUPPORTED, ERR_CRYPTO_SIGN_KEY_REQUIRED, ERR_DIR_CLOSED, ERR_DIR_CONCURRENT_OPERATION, ERR_DNS_SET_SERVERS_FAILED, ERR_DOMAIN_CALLBACK_NOT_AVAILABLE, ERR_DOMAIN_CANNOT_SET_UNCAUGHT_EXCEPTION_CAPTURE, ERR_ENCODING_INVALID_ENCODED_DATA, ERR_ENCODING_NOT_SUPPORTED, ERR_EVAL_ESM_CANNOT_PRINT, ERR_EVENT_RECURSION, ERR_FALSY_VALUE_REJECTION, ERR_FEATURE_UNAVAILABLE_ON_PLATFORM, ERR_FS_EISDIR, ERR_FS_FILE_TOO_LARGE, ERR_FS_INVALID_SYMLINK_TYPE, ERR_FS_RMDIR_ENOTDIR, ERR_HTTP2_ALTSVC_INVALID_ORIGIN, ERR_HTTP2_ALTSVC_LENGTH, ERR_HTTP2_CONNECT_AUTHORITY, ERR_HTTP2_CONNECT_PATH, ERR_HTTP2_CONNECT_SCHEME, ERR_HTTP2_GOAWAY_SESSION, ERR_HTTP2_HEADERS_AFTER_RESPOND, ERR_HTTP2_HEADERS_SENT, ERR_HTTP2_HEADER_SINGLE_VALUE, ERR_HTTP2_INFO_STATUS_NOT_ALLOWED, ERR_HTTP2_INVALID_CONNECTION_HEADERS, ERR_HTTP2_INVALID_HEADER_VALUE, ERR_HTTP2_INVALID_INFO_STATUS, ERR_HTTP2_INVALID_ORIGIN, ERR_HTTP2_INVALID_PACKED_SETTINGS_LENGTH, ERR_HTTP2_INVALID_PSEUDOHEADER, ERR_HTTP2_INVALID_SESSION, ERR_HTTP2_INVALID_SETTING_VALUE, ERR_HTTP2_INVALID_STREAM, ERR_HTTP2_MAX_PENDING_SETTINGS_ACK, ERR_HTTP2_NESTED_PUSH, ERR_HTTP2_NO_SOCKET_MANIPULATION, ERR_HTTP2_ORIGIN_LENGTH, ERR_HTTP2_OUT_OF_STREAMS, ERR_HTTP2_PAYLOAD_FORBIDDEN, ERR_HTTP2_PING_CANCEL, ERR_HTTP2_PING_LENGTH, ERR_HTTP2_PSEUDOHEADER_NOT_ALLOWED, ERR_HTTP2_PUSH_DISABLED, ERR_HTTP2_SEND_FILE, ERR_HTTP2_SEND_FILE_NOSEEK, ERR_HTTP2_SESSION_ERROR, ERR_HTTP2_SETTINGS_CANCEL, ERR_HTTP2_SOCKET_BOUND, ERR_HTTP2_SOCKET_UNBOUND, ERR_HTTP2_STATUS_101, ERR_HTTP2_STATUS_INVALID, ERR_HTTP2_STREAM_CANCEL, ERR_HTTP2_STREAM_ERROR, ERR_HTTP2_STREAM_SELF_DEPENDENCY, ERR_HTTP2_TRAILERS_ALREADY_SENT, ERR_HTTP2_TRAILERS_NOT_READY, ERR_HTTP2_UNSUPPORTED_PROTOCOL, ERR_HTTP_HEADERS_SENT, ERR_HTTP_INVALID_HEADER_VALUE, ERR_HTTP_INVALID_STATUS_CODE, ERR_HTTP_SOCKET_ENCODING, ERR_HTTP_TRAILER_INVALID, ERR_INCOMPATIBLE_OPTION_PAIR, ERR_INPUT_TYPE_NOT_ALLOWED, ERR_INSPECTOR_ALREADY_ACTIVATED, ERR_INSPECTOR_ALREADY_CONNECTED, ERR_INSPECTOR_CLOSED, ERR_INSPECTOR_COMMAND, ERR_INSPECTOR_NOT_ACTIVE, ERR_INSPECTOR_NOT_AVAILABLE, ERR_INSPECTOR_NOT_CONNECTED, ERR_INSPECTOR_NOT_WORKER, ERR_INTERNAL_ASSERTION, ERR_INVALID_ADDRESS_FAMILY, ERR_INVALID_ARG_TYPE, ERR_INVALID_ARG_TYPE_RANGE, ERR_INVALID_ARG_VALUE, ERR_INVALID_ARG_VALUE_RANGE, ERR_INVALID_ASYNC_ID, ERR_INVALID_BUFFER_SIZE, ERR_INVALID_CHAR, ERR_INVALID_CURSOR_POS, ERR_INVALID_FD, ERR_INVALID_FD_TYPE, ERR_INVALID_FILE_URL_HOST, ERR_INVALID_FILE_URL_PATH, ERR_INVALID_HANDLE_TYPE, ERR_INVALID_HTTP_TOKEN, ERR_INVALID_IP_ADDRESS, ERR_INVALID_MODULE_SPECIFIER, ERR_INVALID_OPT_VALUE, ERR_INVALID_OPT_VALUE_ENCODING, ERR_INVALID_PACKAGE_CONFIG, ERR_INVALID_PACKAGE_TARGET, ERR_INVALID_PERFORMANCE_MARK, ERR_INVALID_PROTOCOL, ERR_INVALID_REPL_EVAL_CONFIG, ERR_INVALID_REPL_INPUT, ERR_INVALID_RETURN_PROPERTY, ERR_INVALID_RETURN_PROPERTY_VALUE, ERR_INVALID_RETURN_VALUE, ERR_INVALID_SYNC_FORK_INPUT, ERR_INVALID_THIS, ERR_INVALID_TUPLE, ERR_INVALID_URI, ERR_INVALID_URL, ERR_INVALID_URL_SCHEME, ERR_IPC_CHANNEL_CLOSED, ERR_IPC_DISCONNECTED, ERR_IPC_ONE_PIPE, ERR_IPC_SYNC_FORK, ERR_MANIFEST_DEPENDENCY_MISSING, ERR_MANIFEST_INTEGRITY_MISMATCH, ERR_MANIFEST_INVALID_RESOURCE_FIELD, ERR_MANIFEST_TDZ, ERR_MANIFEST_UNKNOWN_ONERROR, ERR_METHOD_NOT_IMPLEMENTED, ERR_MISSING_ARGS, ERR_MISSING_OPTION, ERR_MODULE_NOT_FOUND, ERR_MULTIPLE_CALLBACK, ERR_NAPI_CONS_FUNCTION, ERR_NAPI_INVALID_DATAVIEW_ARGS, ERR_NAPI_INVALID_TYPEDARRAY_ALIGNMENT, ERR_NAPI_INVALID_TYPEDARRAY_LENGTH, ERR_NO_CRYPTO, ERR_NO_ICU, ERR_OUT_OF_RANGE, ERR_PACKAGE_IMPORT_NOT_DEFINED, ERR_PACKAGE_PATH_NOT_EXPORTED, ERR_QUICCLIENTSESSION_FAILED, ERR_QUICCLIENTSESSION_FAILED_SETSOCKET, ERR_QUICSESSION_DESTROYED, ERR_QUICSESSION_INVALID_DCID, ERR_QUICSESSION_UPDATEKEY, ERR_QUICSOCKET_DESTROYED, ERR_QUICSOCKET_INVALID_STATELESS_RESET_SECRET_LENGTH, ERR_QUICSOCKET_LISTENING, ERR_QUICSOCKET_UNBOUND, ERR_QUICSTREAM_DESTROYED, ERR_QUICSTREAM_INVALID_PUSH, ERR_QUICSTREAM_OPEN_FAILED, ERR_QUICSTREAM_UNSUPPORTED_PUSH, ERR_QUIC_TLS13_REQUIRED, ERR_SCRIPT_EXECUTION_INTERRUPTED, ERR_SERVER_ALREADY_LISTEN, ERR_SERVER_NOT_RUNNING, ERR_SOCKET_ALREADY_BOUND, ERR_SOCKET_BAD_BUFFER_SIZE, ERR_SOCKET_BAD_PORT, ERR_SOCKET_BAD_TYPE, ERR_SOCKET_BUFFER_SIZE, ERR_SOCKET_CLOSED, ERR_SOCKET_DGRAM_IS_CONNECTED, ERR_SOCKET_DGRAM_NOT_CONNECTED, ERR_SOCKET_DGRAM_NOT_RUNNING, ERR_SRI_PARSE, ERR_STREAM_ALREADY_FINISHED, ERR_STREAM_CANNOT_PIPE, ERR_STREAM_DESTROYED, ERR_STREAM_NULL_VALUES, ERR_STREAM_PREMATURE_CLOSE, ERR_STREAM_PUSH_AFTER_EOF, ERR_STREAM_UNSHIFT_AFTER_END_EVENT, ERR_STREAM_WRAP, ERR_STREAM_WRITE_AFTER_END, ERR_SYNTHETIC, ERR_TLS_CERT_ALTNAME_INVALID, ERR_TLS_DH_PARAM_SIZE, ERR_TLS_HANDSHAKE_TIMEOUT, ERR_TLS_INVALID_CONTEXT, ERR_TLS_INVALID_PROTOCOL_VERSION, ERR_TLS_INVALID_STATE, ERR_TLS_PROTOCOL_VERSION_CONFLICT, ERR_TLS_RENEGOTIATION_DISABLED, ERR_TLS_REQUIRED_SERVER_NAME, ERR_TLS_SESSION_ATTACK, ERR_TLS_SNI_FROM_SERVER, ERR_TRACE_EVENTS_CATEGORY_REQUIRED, ERR_TRACE_EVENTS_UNAVAILABLE, ERR_UNAVAILABLE_DURING_EXIT, ERR_UNCAUGHT_EXCEPTION_CAPTURE_ALREADY_SET, ERR_UNESCAPED_CHARACTERS, ERR_UNHANDLED_ERROR, ERR_UNKNOWN_BUILTIN_MODULE, ERR_UNKNOWN_CREDENTIAL, ERR_UNKNOWN_ENCODING, ERR_UNKNOWN_FILE_EXTENSION, ERR_UNKNOWN_MODULE_FORMAT, ERR_UNKNOWN_SIGNAL, ERR_UNSUPPORTED_DIR_IMPORT, ERR_UNSUPPORTED_ESM_URL_SCHEME, ERR_USE_AFTER_CLOSE, ERR_V8BREAKITERATOR, ERR_VALID_PERFORMANCE_ENTRY_TYPE, ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING, ERR_VM_MODULE_ALREADY_LINKED, ERR_VM_MODULE_CANNOT_CREATE_CACHED_DATA, ERR_VM_MODULE_DIFFERENT_CONTEXT, ERR_VM_MODULE_LINKING_ERRORED, ERR_VM_MODULE_NOT_MODULE, ERR_VM_MODULE_STATUS, ERR_WASI_ALREADY_STARTED, ERR_WORKER_INIT_FAILED, ERR_WORKER_NOT_RUNNING, ERR_WORKER_OUT_OF_MEMORY, ERR_WORKER_UNSERIALIZABLE_ERROR, ERR_WORKER_UNSUPPORTED_EXTENSION, ERR_WORKER_UNSUPPORTED_OPERATION, ERR_ZLIB_INITIALIZATION_FAILED, NodeError, NodeErrorAbstraction, NodeRangeError, NodeSyntaxError, NodeTypeError, NodeURIError, aggregateTwoErrors, codes, connResetException, denoErrorToNodeError, dnsException, errnoException, errorMap, exceptionWithHostPort, genericNodeError, hideStackFrames, isStackOverflowError, uvException, uvExceptionWithHostPort,};
std

Version Info

Tagged at
a year ago