promise-reject-rethrow
Rethrow Promise rejection in the same tick. Useful to generate core dumps when using Promises.
WARNING: THIS PACKAGE FORCES EXIT ON UNHANDLED REJECTIONS
This package is still experimental. Behavior can drastically change in future versions.
Usage
// example.js { throw ;} { { ; };} ;
$ npm install --save promise-reject-rethrow example.js$ node -r promise-reject-rethrow example.js/Users/mmarchini/workspace/mmarchini/promise-reject-rethrow/index.js:4 throw reason; ^ Error at wee at bar at new Promise at foo at Object.<anonymous> at Module._compile at Object.Module._extensions..js at Module.load at tryModuleLoad at Function.Module._load
Or, if you want to generate a core dump on unhandled rejections:
$ node -r promise-reject-rethrow --abort-on-uncaught-exception example.js
Caveats
Stack trace for the core dump is not complete, we're still missing calls in the Promise resolution path.