* --unhandled-rejections=throw: * Emit 'unhandledRejection', if it's unhandled, emit * 'uncaughtException'. If it's not handled, print the error to stderr * and exit the process. * @type {UnhandledRejectionsModeHandler}
(promise, promiseInfo)
| 314 | * @type {UnhandledRejectionsModeHandler} |
| 315 | */ |
| 316 | function throwUnhandledRejectionsMode(promise, promiseInfo) { |
| 317 | const reason = promiseInfo.reason; |
| 318 | const handled = emitUnhandledRejection(promise, promiseInfo); |
| 319 | if (!handled) { |
| 320 | const err = isErrorLike(reason) ? |
| 321 | reason : |
| 322 | new UnhandledPromiseRejection(reason); |
| 323 | // This destroys the async stack, don't clear it after |
| 324 | triggerUncaughtException(err, true /* fromPromise */); |
| 325 | return false; |
| 326 | } |
| 327 | return true; |
| 328 | } |
| 329 | |
| 330 | /** |
| 331 | * --unhandled-rejections=warn-with-error-code: |
nothing calls this directly
no test coverage detected