Commit 2cbbaaf
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)
PR-URL: #5756
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Andreas Madsen <amwebdk@gmail.com>1 parent 6f16882 commit 2cbbaafCopy full SHA for 2cbbaaf
File tree
Expand file treeCollapse file tree
5 files changed
+134
-12
lines changedOpen diff view settings
Filter options
- src
- test/parallel
Expand file treeCollapse file tree
5 files changed
+134
-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
+34-4Lines changed: 34 additions & 4 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1175 | 1175 | |
1176 | 1176 | |
1177 | 1177 | |
1178 | | - |
1179 | | - |
| 1178 | + |
| 1179 | + |
| 1180 | + |
| 1181 | + |
| 1182 | + |
| 1183 | + |
| 1184 | + |
1180 | 1185 | |
1181 | 1186 | |
1182 | 1187 | |
| ||
1187 | 1192 | |
1188 | 1193 | |
1189 | 1194 | |
1190 | | - |
1191 | | - |
| 1195 | + |
| 1196 | + |
| 1197 | + |
| 1198 | + |
| 1199 | + |
| 1200 | + |
| 1201 | + |
| 1202 | + |
1192 | 1203 | |
1193 | 1204 | |
1194 | 1205 | |
| ||
2363 | 2374 | |
2364 | 2375 | |
2365 | 2376 | |
| 2377 | + |
| 2378 | + |
| 2379 | + |
| 2380 | + |
| 2381 | + |
| 2382 | + |
| 2383 | + |
| 2384 | + |
| 2385 | + |
| 2386 | + |
| 2387 | + |
| 2388 | + |
| 2389 | + |
| 2390 | + |
| 2391 | + |
| 2392 | + |
| 2393 | + |
| 2394 | + |
| 2395 | + |
2366 | 2396 | |
2367 | 2397 | |
2368 | 2398 | |
|
Collapse file
+5Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
234 | 234 | |
235 | 235 | |
236 | 236 | |
| 237 | + |
| 238 | + |
| 239 | + |
| 240 | + |
| 241 | + |
237 | 242 | |
238 | 243 | |
239 | 244 | |
|
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