-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
Closed
Labels
confirmed-bugIssues with confirmed bugs.Issues with confirmed bugs.errorsIssues and PRs related to JavaScript errors originated in Node.js core.Issues and PRs related to JavaScript errors originated in Node.js core.
Description
- Version: v12.6.0
- Platform: Darwin Bastians-MBP 18.6.0 Darwin Kernel Version 18.6.0: Thu Apr 25 23:16:27 PDT 2019; root:xnu-4903.261.4~2/RELEASE_X86_64 x86_64
Up to version 12.5.0, when rethrowing the error from an uncaughtException handler, the original stack trace would be preserved. In version 12.6.0, this is no longer the case. Instead, a stack trace with only one line is printed, showing the callsite where the error has been rethrown.
rethrow.js:
'use strict';
process.on('uncaughtException', err => {
throw err;
});
function throwUncaughtError() {
throw new Error('Boom');
}
throwUncaughtError();
Running the above in 12.5.0 and 12.6.0 shows the difference:
> nvm use 12.5.0 && node rethrow
Now using node v12.5.0 (npm v6.9.0)
/Users/bastian/instana/code/nodejs/packages/collector/test/uncaught/apps/rethrow.js:4
throw err;
^
Error: Boom
at throwUncaughtError (/Users/bastian/instana/code/nodejs/packages/collector/test/uncaught/apps/rethrow.js:8:9)
at Object.<anonymous> (/Users/bastian/instana/code/nodejs/packages/collector/test/uncaught/apps/rethrow.js:11:1)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:643:32)
at Function.Module._load (internal/modules/cjs/loader.js:556:12)
at Function.Module.runMain (internal/modules/cjs/loader.js:839:10)
at internal/main/run_main_module.js:17:11
> nvm use 12.6.0 && node rethrow
Now using node v12.6.0 (npm v6.9.0)
/Users/bastian/instana/code/nodejs/packages/collector/test/uncaught/apps/rethrow.js:4
throw err;
^
Error: Boom
>
Commits 0fd6524 and 5b92eb4 might be related to this change in behaviour.
Hakerh400 and BridgeAR
Metadata
Metadata
Assignees
Labels
confirmed-bugIssues with confirmed bugs.Issues with confirmed bugs.errorsIssues and PRs related to JavaScript errors originated in Node.js core.Issues and PRs related to JavaScript errors originated in Node.js core.