* --unhandled-rejections=warn-with-error-code: * Emit 'unhandledRejection', if it's unhandled, emit * 'UnhandledPromiseRejectionWarning', then set process exit code to 1. * @type {UnhandledRejectionsModeHandler}
(promise, promiseInfo)
| 334 | * @type {UnhandledRejectionsModeHandler} |
| 335 | */ |
| 336 | function warnWithErrorCodeUnhandledRejectionsMode(promise, promiseInfo) { |
| 337 | const handled = emitUnhandledRejection(promise, promiseInfo); |
| 338 | if (!handled) { |
| 339 | emitUnhandledRejectionWarning(promiseInfo); |
| 340 | process.exitCode = kGenericUserError; |
| 341 | } |
| 342 | return true; |
| 343 | } |
| 344 | |
| 345 | /** |
| 346 | * @returns {UnhandledRejectionsModeHandler} |
nothing calls this directly
no test coverage detected