Skip to content

promise: better stack traces for --trace-warnings

Checklist
  • make -j8 test (UNIX), or vcbuild test nosign (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

promises

Description of change

Give better stack traces for PromiseRejectionHandledWarningand UnhandledPromiseRejectionWarnings.

For PromiseRejectionHandledWarning, when it is likely that there is an Error object generated, it is created early to provide a proper stack trace.

For UnhandledPromiseRejectionWarning, the stack trace of the underlying error object is used, if possible.

Fixes: https://github.com/nodejs/node/issues/9523

Merge request reports

Loading