* @returns {UnhandledRejectionsModeHandler}
()
| 346 | * @returns {UnhandledRejectionsModeHandler} |
| 347 | */ |
| 348 | function 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 |
no test coverage detected