Commit 23c2f53
committed
fix: prevent unhandled promise rejection when done() throws
Add .catch(safeReject) to pendingDones promises so that errors from
done() (e.g. invalid output schema) are caught instead of becoming
unhandled promise rejections that crash the process.
In develop, these errors are caught by the worker message handler's
try/catch → reject(). With pendingDones pattern, the promise could
reject after the exit handler already resolved, causing a crash.
Signed-off-by: NikolayZezin-envision <nikolay.zezin@envisionblockchain.com>1 parent 796b96b commit 23c2f53
1 file changed
Lines changed: 2 additions & 2 deletions
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
305 | 305 | | |
306 | 306 | | |
307 | 307 | | |
308 | | - | |
| 308 | + | |
309 | 309 | | |
310 | 310 | | |
311 | 311 | | |
| |||
362 | 362 | | |
363 | 363 | | |
364 | 364 | | |
365 | | - | |
| 365 | + | |
366 | 366 | | |
367 | 367 | | |
368 | 368 | | |
| |||
0 commit comments