Commit 0aa255a
bootstrap: handle snapshot errors gracefully
This patch refactors the SnapshotBuilder::Generate() routines
so that when running into errors during the snapshot building
process, they can exit gracefully by printing the error
and return a non-zero exit code. If the error is likely to
be caused by internal scripts, the return code would be 12,
if the error is caused by user scripts the return code would
be 1. In addition this refactors the generation of embedded
snapshots and directly writes to the output file stream
instead of producing an intermediate string with string
streams.
PR-URL: #43531
Refs: #35711
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>1 parent 361a643 commit 0aa255aCopy full SHA for 0aa255a
File tree
Expand file treeCollapse file tree
6 files changed
+205
-172
lines changedOpen diff view settings
Filter options
- doc/api
- src
- test/fixtures/snapshot
- tools/snapshot
Expand file treeCollapse file tree
6 files changed
+205
-172
lines changedOpen diff view settings
Collapse file
+3Lines changed: 3 additions & 0 deletions
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
3820 | 3820 | |
3821 | 3821 | |
3822 | 3822 | |
| 3823 | + |
| 3824 | + |
| 3825 | + |
3823 | 3826 | |
3824 | 3827 | |
3825 | 3828 | |
|
Collapse file
+16-3Lines changed: 16 additions & 3 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
963 | 963 | |
964 | 964 | |
965 | 965 | |
966 | | - |
967 | | - |
968 | | - |
| 966 | + |
969 | 967 | |
970 | 968 | |
971 | 969 | |
972 | 970 | |
| 971 | + |
| 972 | + |
| 973 | + |
| 974 | + |
| 975 | + |
| 976 | + |
973 | 977 | |
974 | 978 | |
975 | 979 | |
| ||
979 | 983 | |
980 | 984 | |
981 | 985 | |
| 986 | + |
| 987 | + |
| 988 | + |
| 989 | + |
| 990 | + |
| 991 | + |
| 992 | + |
| 993 | + |
| 994 | + |
982 | 995 | |
983 | 996 | |
984 | 997 | |
|
Collapse file
src/node_snapshot_builder.h
Copy file name to clipboardExpand all lines: src/node_snapshot_builder.h+6-5Lines changed: 6 additions & 5 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
15 | 15 | |
16 | 16 | |
17 | 17 | |
18 | | - |
19 | | - |
| 18 | + |
| 19 | + |
| 20 | + |
20 | 21 | |
21 | 22 | |
22 | | - |
23 | | - |
24 | | - |
| 23 | + |
| 24 | + |
| 25 | + |
25 | 26 | |
26 | 27 | |
27 | 28 | |
|
0 commit comments