MCPcopy Index your code
hub / github.com/nodejs/node / warnWithErrorCodeUnhandledRejectionsMode

Function warnWithErrorCodeUnhandledRejectionsMode

lib/internal/process/promises.js:336–343  ·  view source on GitHub ↗

* --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)

Source from the content-addressed store, hash-verified

334 * @type {UnhandledRejectionsModeHandler}
335 */
336function 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}

Callers

nothing calls this directly

Calls 2

emitUnhandledRejectionFunction · 0.85

Tested by

no test coverage detected