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

Function getUnhandledRejectionsMode

lib/internal/process/promises.js:348–364  ·  view source on GitHub ↗

* @returns {UnhandledRejectionsModeHandler}

()

Source from the content-addressed store, hash-verified

346 * @returns {UnhandledRejectionsModeHandler}
347 */
348function getUnhandledRejectionsMode() {
349 const { getOptionValue } = require('internal/options');
350 switch (getOptionValue('--unhandled-rejections')) {
351 case 'none':
352 return ignoreUnhandledRejectionsMode;
353 case 'warn':
354 return alwaysWarnUnhandledRejectionsMode;
355 case 'strict':
356 return strictUnhandledRejectionsMode;
357 case 'throw':
358 return throwUnhandledRejectionsMode;
359 case 'warn-with-error-code':
360 return warnWithErrorCodeUnhandledRejectionsMode;
361 default:
362 return throwUnhandledRejectionsMode;
363 }
364}
365
366// If this method returns true, we've executed user code or triggered
367// a warning to be emitted which requires the microtask and next tick

Callers 1

promiseRejectHandlerFunction · 0.85

Calls 2

getOptionValueFunction · 0.85
requireFunction · 0.50

Tested by

no test coverage detected