()
| 367 | } |
| 368 | |
| 369 | private registerUnhandledRejection() { |
| 370 | const onUnhandledRejection = (err: unknown) => { |
| 371 | process.exitCode = 1 |
| 372 | |
| 373 | this.printError(err, { |
| 374 | fullStack: true, |
| 375 | type: 'Unhandled Rejection', |
| 376 | }) |
| 377 | |
| 378 | this.error('\n\n') |
| 379 | process.exit() |
| 380 | } |
| 381 | |
| 382 | process.on('unhandledRejection', onUnhandledRejection) |
| 383 | |
| 384 | this.ctx.onClose(() => { |
| 385 | process.off('unhandledRejection', onUnhandledRejection) |
| 386 | }) |
| 387 | } |
| 388 | } |
no test coverage detected