Commit 747f107
async_wrap: don't abort on callback exception
Rather than abort if the init/pre/post/final/destroy callbacks throw,
force the exception to propagate and not be made catchable. This way
the application is still not allowed to proceed but also allowed the
location of the failure to print before exiting. Though the stack itself
may not be of much use since all callbacks except init are called from
the bottom of the call stack.
/tmp/async-test.js:14
throw new Error('pre');
^
Error: pre
at InternalFieldObject.pre (/tmp/async-test.js:14:9)
Ref: #7048
PR-URL: #5756
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Andreas Madsen <amwebdk@gmail.com>1 parent c06e2b0 commit 747f107Copy full SHA for 747f107
File tree
Expand file treeCollapse file tree
5 files changed
+135
-12
lines changedOpen diff view settings
Filter options
- src
- test/parallel
Expand file treeCollapse file tree
5 files changed
+135
-12
lines changedOpen diff view settings
Collapse file
+11-4Lines changed: 11 additions & 4 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
51 | 51 | |
52 | 52 | |
53 | 53 | |
| 54 | + |
| 55 | + |
54 | 56 | |
55 | 57 | |
56 | 58 | |
57 | | - |
58 | | - |
| 59 | + |
| 60 | + |
| 61 | + |
| 62 | + |
59 | 63 | |
60 | 64 | |
61 | 65 | |
| ||
69 | 73 | |
70 | 74 | |
71 | 75 | |
| 76 | + |
72 | 77 | |
73 | 78 | |
74 | | - |
75 | | - |
| 79 | + |
| 80 | + |
| 81 | + |
| 82 | + |
76 | 83 | |
77 | 84 | |
78 | 85 | |
|
Collapse file
+16-4Lines changed: 16 additions & 4 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
18 | 18 | |
19 | 19 | |
20 | 20 | |
| 21 | + |
21 | 22 | |
22 | 23 | |
23 | 24 | |
| ||
225 | 226 | |
226 | 227 | |
227 | 228 | |
228 | | - |
229 | | - |
| 229 | + |
| 230 | + |
| 231 | + |
| 232 | + |
| 233 | + |
| 234 | + |
| 235 | + |
230 | 236 | |
231 | 237 | |
232 | 238 | |
233 | 239 | |
234 | 240 | |
235 | 241 | |
236 | 242 | |
237 | | - |
238 | | - |
| 243 | + |
| 244 | + |
| 245 | + |
| 246 | + |
| 247 | + |
| 248 | + |
| 249 | + |
| 250 | + |
239 | 251 | |
240 | 252 | |
241 | 253 | |
|
Collapse file
+35-4Lines changed: 35 additions & 4 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
115 | 115 | |
116 | 116 | |
117 | 117 | |
| 118 | + |
118 | 119 | |
119 | 120 | |
120 | 121 | |
| ||
1165 | 1166 | |
1166 | 1167 | |
1167 | 1168 | |
1168 | | - |
1169 | | - |
| 1169 | + |
| 1170 | + |
| 1171 | + |
| 1172 | + |
| 1173 | + |
| 1174 | + |
| 1175 | + |
1170 | 1176 | |
1171 | 1177 | |
1172 | 1178 | |
| ||
1177 | 1183 | |
1178 | 1184 | |
1179 | 1185 | |
1180 | | - |
1181 | | - |
| 1186 | + |
| 1187 | + |
| 1188 | + |
| 1189 | + |
| 1190 | + |
| 1191 | + |
| 1192 | + |
| 1193 | + |
1182 | 1194 | |
1183 | 1195 | |
1184 | 1196 | |
| ||
2352 | 2364 | |
2353 | 2365 | |
2354 | 2366 | |
| 2367 | + |
| 2368 | + |
| 2369 | + |
| 2370 | + |
| 2371 | + |
| 2372 | + |
| 2373 | + |
| 2374 | + |
| 2375 | + |
| 2376 | + |
| 2377 | + |
| 2378 | + |
| 2379 | + |
| 2380 | + |
| 2381 | + |
| 2382 | + |
| 2383 | + |
| 2384 | + |
| 2385 | + |
2355 | 2386 | |
2356 | 2387 | |
2357 | 2388 | |
|
Collapse file
+5Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
237 | 237 | |
238 | 238 | |
239 | 239 | |
| 240 | + |
| 241 | + |
| 242 | + |
| 243 | + |
| 244 | + |
240 | 245 | |
241 | 246 | |
242 | 247 | |
|
Collapse file
test/parallel/test-async-wrap-throw-from-callback.js
Copy file name to clipboard+68Lines changed: 68 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 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 | + |
0 commit comments