Commit be525d7
authored
src: consolidate exit codes in the code base
Add an ExitCode enum class and use it throughout the code base
instead of hard-coding the exit codes everywhere. At the moment,
the exit codes used in many places do not actually conform to
what the documentation describes. With the new enums (which
are also available to the JS land as constants in an internal
binding) we could migrate to a more consistent usage of the
codes, and eventually expose the constants to the user land
when they are stable enough.
PR-URL: #44746
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>1 parent 66cedb4 commit be525d7Copy full SHA for be525d7
File tree
Expand file treeCollapse file tree
36 files changed
+379
-175
lines changedOpen diff view settings
Filter options
- lib/internal
- cluster
- debugger
- main
- modules/esm
- policy
- process
- test_runner
- src
- api
- tools/snapshot
Expand file treeCollapse file tree
36 files changed
+379
-175
lines changedOpen diff view settings
Collapse file
lib/internal/async_hooks.js
Copy file name to clipboardExpand all lines: lib/internal/async_hooks.js+3-1Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
8 | 8 | |
9 | 9 | |
10 | 10 | |
| 11 | + |
| 12 | + |
11 | 13 | |
12 | 14 | |
13 | 15 | |
| ||
171 | 173 | |
172 | 174 | |
173 | 175 | |
174 | | - |
| 176 | + |
175 | 177 | |
176 | 178 | |
177 | 179 | |
|
Collapse file
lib/internal/cluster/child.js
Copy file name to clipboardExpand all lines: lib/internal/cluster/child.js+5-3Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
15 | 15 | |
16 | 16 | |
17 | 17 | |
| 18 | + |
| 19 | + |
18 | 20 | |
19 | 21 | |
20 | 22 | |
| ||
43 | 45 | |
44 | 46 | |
45 | 47 | |
46 | | - |
| 48 | + |
47 | 49 | |
48 | 50 | |
49 | 51 | |
| ||
278 | 280 | |
279 | 281 | |
280 | 282 | |
281 | | - |
| 283 | + |
282 | 284 | |
283 | 285 | |
284 | 286 | |
285 | | - |
| 287 | + |
286 | 288 | |
287 | 289 | |
Collapse file
lib/internal/debugger/inspect.js
Copy file name to clipboardExpand all lines: lib/internal/debugger/inspect.js+12-5Lines changed: 12 additions & 5 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
44 | 44 | |
45 | 45 | |
46 | 46 | |
| 47 | + |
| 48 | + |
| 49 | + |
| 50 | + |
| 51 | + |
| 52 | + |
47 | 53 | |
48 | 54 | |
49 | 55 | |
| ||
167 | 173 | |
168 | 174 | |
169 | 175 | |
170 | | - |
| 176 | + |
171 | 177 | |
172 | 178 | |
173 | 179 | |
| ||
234 | 240 | |
235 | 241 | |
236 | 242 | |
237 | | - |
| 243 | + |
238 | 244 | |
239 | 245 | |
240 | 246 | |
| ||
314 | 320 | |
315 | 321 | |
316 | 322 | |
317 | | - |
| 323 | + |
318 | 324 | |
319 | 325 | |
320 | 326 | |
| ||
337 | 343 | |
338 | 344 | |
339 | 345 | |
340 | | - |
| 346 | + |
| 347 | + |
341 | 348 | |
342 | 349 | |
343 | 350 | |
| ||
355 | 362 | |
356 | 363 | |
357 | 364 | |
358 | | - |
| 365 | + |
359 | 366 | |
360 | 367 | |
361 | 368 | |
|
Collapse file
+4-1Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
17 | 17 | |
18 | 18 | |
19 | 19 | |
| 20 | + |
| 21 | + |
20 | 22 | |
21 | 23 | |
22 | 24 | |
| ||
31 | 33 | |
32 | 34 | |
33 | 35 | |
34 | | - |
| 36 | + |
| 37 | + |
35 | 38 | |
36 | 39 | |
37 | 40 | |
|
Collapse file
lib/internal/main/test_runner.js
Copy file name to clipboardExpand all lines: lib/internal/main/test_runner.js+2-1Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
5 | 5 | |
6 | 6 | |
7 | 7 | |
| 8 | + |
8 | 9 | |
9 | 10 | |
10 | 11 | |
| ||
22 | 23 | |
23 | 24 | |
24 | 25 | |
25 | | - |
| 26 | + |
26 | 27 | |
Collapse file
lib/internal/main/watch_mode.js
Copy file name to clipboardExpand all lines: lib/internal/main/watch_mode.js+5-3Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
12 | 12 | |
13 | 13 | |
14 | 14 | |
15 | | - |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | + |
16 | 19 | |
17 | 20 | |
18 | 21 | |
| ||
24 | 27 | |
25 | 28 | |
26 | 29 | |
27 | | - |
28 | 30 | |
29 | 31 | |
30 | 32 | |
| ||
125 | 127 | |
126 | 128 | |
127 | 129 | |
128 | | - |
| 130 | + |
129 | 131 | |
130 | 132 | |
131 | 133 | |
|
Collapse file
lib/internal/main/worker_thread.js
Copy file name to clipboardExpand all lines: lib/internal/main/worker_thread.js+2-1Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
66 | 66 | |
67 | 67 | |
68 | 68 | |
| 69 | + |
69 | 70 | |
70 | 71 | |
71 | 72 | |
| ||
234 | 235 | |
235 | 236 | |
236 | 237 | |
237 | | - |
| 238 | + |
238 | 239 | |
239 | 240 | |
240 | 241 | |
|
Collapse file
lib/internal/modules/esm/handle_process_exit.js
Copy file name to clipboardExpand all lines: lib/internal/modules/esm/handle_process_exit.js+3-1Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1 | 1 | |
2 | 2 | |
| 3 | + |
| 4 | + |
3 | 5 | |
4 | 6 | |
5 | 7 | |
6 | 8 | |
7 | | - |
| 9 | + |
8 | 10 | |
9 | 11 | |
10 | 12 | |
|
Collapse file
lib/internal/policy/manifest.js
Copy file name to clipboardExpand all lines: lib/internal/policy/manifest.js+3-1Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
40 | 40 | |
41 | 41 | |
42 | 42 | |
| 43 | + |
| 44 | + |
43 | 45 | |
44 | 46 | |
45 | 47 | |
| ||
72 | 74 | |
73 | 75 | |
74 | 76 | |
75 | | - |
| 77 | + |
76 | 78 | |
77 | 79 | |
78 | 80 | |
|
Collapse file
lib/internal/process/execution.js
Copy file name to clipboardExpand all lines: lib/internal/process/execution.js+3-2Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
14 | 14 | |
15 | 15 | |
16 | 16 | |
| 17 | + |
17 | 18 | |
18 | 19 | |
19 | 20 | |
| ||
161 | 162 | |
162 | 163 | |
163 | 164 | |
164 | | - |
165 | | - |
| 165 | + |
| 166 | + |
166 | 167 | |
167 | 168 | |
168 | 169 | |
|
0 commit comments