When using Promise.join, unhandled errors/exceptions result in an error message with no stack trace.
Adding a .catch and immediately re-throwing (as shown in the second case below) works as expected. Similarly, adding a Promise.onPossiblyUnhandledRejection handler also results in the correct error / stack trace.
The following code can be used to reproduce this:
varPromise=require('bluebird');varfs=require('fs');Promise.promisifyAll(fs);functionrejectResult(){returnfs.readFileAsync('no such file');}functiongoodResult(){returnPromise.resolve('test');}Promise.all([rejectResult(),goodResult()]).then(function(){});// Possibly unhandled Error: ENOENT, open 'no such file'Promise.join(rejectResult(),goodResult(),function(file,val){}).catch(function(err){throwerr;});// Possibly unhandled Error: ENOENT, open 'no such file'Promise.join(rejectResult(),goodResult(),function(file,val){});// Possibly unhandled (<{"p5":null,"p4":null,"p3":null,"p2":"t...>, no stack trace)
The text was updated successfully, but these errors were encountered:
When using
Promise.join
, unhandled errors/exceptions result in an error message with no stack trace.Adding a
.catch
and immediately re-throwing (as shown in the second case below) works as expected. Similarly, adding aPromise.onPossiblyUnhandledRejection
handler also results in the correct error / stack trace.The following code can be used to reproduce this:
The text was updated successfully, but these errors were encountered: