Commit c66e647
committed
lib: remove ERR_INVALID_OPT_VALUE and ERR_INVALID_OPT_VALUE_ENCODING
This will be a start to generalize all argument validation
errors. As currently we throw ARG/OPT, OUT_OF_RANGE, and other more
specific errors.
The OPT errors didn't bring much to the errors as it's just another
variant of ARG error which is sometimes more confusing (some of our code
used OPT errors to denote just argument validation errors presumably
because of similarity of OPT to 'option' and not 'options-object')
and they don't specify the name of the options object where the invalid
value is located. Much better approach would be to just specify path
to the invalid value in the name of the value as it is done in this PR
(i.e. 'options.format', 'options.publicKey.type' etc)
Also since this decreases a variety of errors we have it'd be easier to
reuse validation code across the codebase.
Refs: #31251
Refs: #34070 (comment)
Signed-off-by: Denys Otrishko <shishugi@gmail.com>
PR-URL: #34682
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>1 parent 8a8ca4b commit c66e647Copy full SHA for c66e647
File tree
Expand file treeCollapse file tree
63 files changed
+315
-325
lines changedOpen diff view settings
Filter options
- doc/api
- lib
- internal
- crypto
- dns
- fs
- http2
- modules/cjs
- process
- streams
- test
- es-module
- fixtures
- internet
- parallel
- sequential
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Expand file treeCollapse file tree
63 files changed
+315
-325
lines changedOpen diff view settings
Collapse file
+17-4Lines changed: 17 additions & 4 deletions
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
288 | 288 | |
289 | 289 | |
290 | 290 | |
| 291 | + |
| 292 | + |
| 293 | + |
| 294 | + |
291 | 295 | |
292 | 296 | |
293 | 297 | |
| ||
319 | 323 | |
320 | 324 | |
321 | 325 | |
322 | | - |
| 326 | + |
323 | 327 | |
324 | 328 | |
325 | 329 | |
| ||
353 | 357 | |
354 | 358 | |
355 | 359 | |
| 360 | + |
| 361 | + |
| 362 | + |
| 363 | + |
356 | 364 | |
357 | 365 | |
358 | 366 | |
| ||
361 | 369 | |
362 | 370 | |
363 | 371 | |
364 | | - |
| 372 | + |
365 | 373 | |
366 | 374 | |
367 | 375 | |
| ||
401 | 409 | |
402 | 410 | |
403 | 411 | |
| 412 | + |
| 413 | + |
| 414 | + |
| 415 | + |
| 416 | + |
404 | 417 | |
405 | 418 | |
406 | 419 | |
407 | 420 | |
408 | 421 | |
409 | | - |
| 422 | + |
410 | 423 | |
411 | 424 | |
412 | 425 | |
| ||
3274 | 3287 | |
3275 | 3288 | |
3276 | 3289 | |
3277 | | - |
| 3290 | + |
3278 | 3291 | |
3279 | 3292 | |
3280 | 3293 | |
|
Collapse file
+18-10Lines changed: 18 additions & 10 deletions
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1378 | 1378 | |
1379 | 1379 | |
1380 | 1380 | |
1381 | | - |
1382 | | - |
1383 | | - |
1384 | | - |
1385 | | - |
1386 | | - |
1387 | | - |
1388 | | - |
1389 | | - |
1390 | | - |
1391 | 1381 | |
1392 | 1382 | |
1393 | 1383 | |
| ||
2391 | 2381 | |
2392 | 2382 | |
2393 | 2383 | |
| 2384 | + |
| 2385 | + |
| 2386 | + |
| 2387 | + |
| 2388 | + |
| 2389 | + |
| 2390 | + |
| 2391 | + |
| 2392 | + |
| 2393 | + |
| 2394 | + |
| 2395 | + |
| 2396 | + |
| 2397 | + |
| 2398 | + |
| 2399 | + |
| 2400 | + |
| 2401 | + |
2394 | 2402 | |
2395 | 2403 | |
2396 | 2404 | |
|
Collapse file
+1-1Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
98 | 98 | |
99 | 99 | |
100 | 100 | |
101 | | - |
| 101 | + |
102 | 102 | |
103 | 103 | |
104 | 104 | |
|
Collapse file
+5-5Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
32 | 32 | |
33 | 33 | |
34 | 34 | |
35 | | - |
| 35 | + |
36 | 36 | |
37 | 37 | |
38 | 38 | |
| ||
157 | 157 | |
158 | 158 | |
159 | 159 | |
160 | | - |
| 160 | + |
161 | 161 | |
162 | 162 | |
163 | 163 | |
| ||
167 | 167 | |
168 | 168 | |
169 | 169 | |
170 | | - |
| 170 | + |
171 | 171 | |
172 | 172 | |
173 | 173 | |
174 | 174 | |
175 | | - |
| 175 | + |
176 | 176 | |
177 | 177 | |
178 | 178 | |
| ||
210 | 210 | |
211 | 211 | |
212 | 212 | |
213 | | - |
| 213 | + |
214 | 214 | |
215 | 215 | |
216 | 216 | |
|
Collapse file
+1-2Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
86 | 86 | |
87 | 87 | |
88 | 88 | |
89 | | - |
90 | 89 | |
91 | 90 | |
92 | 91 | |
| ||
342 | 341 | |
343 | 342 | |
344 | 343 | |
345 | | - |
| 344 | + |
346 | 345 | |
347 | 346 | |
348 | 347 | |
|
Collapse file
+4-4Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
42 | 42 | |
43 | 43 | |
44 | 44 | |
| 45 | + |
45 | 46 | |
46 | | - |
47 | 47 | |
48 | 48 | |
49 | 49 | |
| ||
115 | 115 | |
116 | 116 | |
117 | 117 | |
118 | | - |
| 118 | + |
119 | 119 | |
120 | 120 | |
121 | 121 | |
| ||
171 | 171 | |
172 | 172 | |
173 | 173 | |
174 | | - |
| 174 | + |
175 | 175 | |
176 | 176 | |
177 | 177 | |
| ||
262 | 262 | |
263 | 263 | |
264 | 264 | |
265 | | - |
| 265 | + |
266 | 266 | |
267 | 267 | |
268 | 268 | |
|
Collapse file
lib/internal/child_process.js
Copy file name to clipboardExpand all lines: lib/internal/child_process.js+5-5Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
11 | 11 | |
12 | 12 | |
13 | 13 | |
| 14 | + |
14 | 15 | |
15 | | - |
16 | 16 | |
17 | 17 | |
18 | 18 | |
| ||
226 | 226 | |
227 | 227 | |
228 | 228 | |
229 | | - |
| 229 | + |
230 | 230 | |
231 | 231 | |
232 | 232 | |
| ||
347 | 347 | |
348 | 348 | |
349 | 349 | |
350 | | - |
| 350 | + |
351 | 351 | |
352 | 352 | |
353 | 353 | |
| ||
934 | 934 | |
935 | 935 | |
936 | 936 | |
937 | | - |
| 937 | + |
938 | 938 | |
939 | 939 | |
940 | 940 | |
| ||
1019 | 1019 | |
1020 | 1020 | |
1021 | 1021 | |
1022 | | - |
| 1022 | + |
1023 | 1023 | |
1024 | 1024 | |
1025 | 1025 | |
|
Collapse file
lib/internal/crypto/cipher.js
Copy file name to clipboardExpand all lines: lib/internal/crypto/cipher.js+2-2Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
12 | 12 | |
13 | 13 | |
14 | 14 | |
15 | | - |
| 15 | + |
16 | 16 | |
17 | 17 | |
18 | 18 | |
| ||
87 | 87 | |
88 | 88 | |
89 | 89 | |
90 | | - |
| 90 | + |
91 | 91 | |
92 | 92 | |
93 | 93 | |
|
Collapse file
lib/internal/crypto/diffiehellman.js
Copy file name to clipboardExpand all lines: lib/internal/crypto/diffiehellman.js+3-3Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
12 | 12 | |
13 | 13 | |
14 | 14 | |
15 | | - |
| 15 | + |
16 | 16 | |
17 | 17 | |
18 | 18 | |
| ||
258 | 258 | |
259 | 259 | |
260 | 260 | |
261 | | - |
| 261 | + |
262 | 262 | |
263 | 263 | |
264 | | - |
| 264 | + |
265 | 265 | |
266 | 266 | |
267 | 267 | |
|
0 commit comments