node/lib/internal/process
Anna Henningsen cef3a04f62
promise: better stack traces for --trace-warnings
Give better stack traces for `PromiseRejectionHandledWarning`
and `UnhandledPromiseRejectionWarning`s.

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
PR-URL: https://github.com/nodejs/node/pull/9525
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2016-12-05 18:33:25 +01:00
..
next_tick.js process: improve performance of nextTick 2016-10-14 09:36:33 -07:00
promises.js promise: better stack traces for --trace-warnings 2016-12-05 18:33:25 +01:00
stdio.js child_process: add public API for IPC channel 2016-11-03 05:39:45 -05:00
warning.js process: fix handling of process.noDeprecation in emitWarning 2016-09-02 13:15:17 -07:00