diff options
author | Anna Henningsen <anna@addaleax.net> | 2019-10-18 18:05:35 +0300 |
---|---|---|
committer | Myles Borins <myles.borins@gmail.com> | 2019-10-23 16:56:20 +0300 |
commit | 5ca58646c1490a79f2c990741a10a5040520c09a (patch) | |
tree | fa8ecec61e12c6e558aa655e9df83bc3d5a942a5 /src/node.cc | |
parent | 39070bbed09ac0ca3fe992a95ce872a0eeb393bc (diff) |
cli: add --trace-uncaught flag
Add a flag that makes Node.js print the stack trace at the
time of *throwing* uncaught exceptions, rather than at the
creation of the `Error` object, if there is any.
This is disabled by default because it affects GC behavior.
PR-URL: https://github.com/nodejs/node/pull/30025
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Diffstat (limited to 'src/node.cc')
-rw-r--r-- | src/node.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/node.cc b/src/node.cc index 935be9343f0..f437ea4be96 100644 --- a/src/node.cc +++ b/src/node.cc @@ -265,6 +265,8 @@ int Environment::InitializeInspector( void Environment::InitializeDiagnostics() { isolate_->GetHeapProfiler()->AddBuildEmbedderGraphCallback( Environment::BuildEmbedderGraph, this); + if (options_->trace_uncaught) + isolate_->SetCaptureStackTraceForUncaughtExceptions(true); #if defined HAVE_DTRACE || defined HAVE_ETW InitDTrace(this); |