Browse Source

stop double printing uncaught error stacks

merge-requests/3/head
tigerbot 7 years ago
parent
commit
da68c102cd
  1. 7
      boot/worker.js

7
boot/worker.js

@ -149,9 +149,10 @@ module.exports.create = function () {
process.on('unhandledRejection', function (err) {
// this should always throw
// (it means somewhere we're not using bluebird by accident)
console.error('[caught] [unhandledRejection]');
console.error(Object.keys(err));
console.error(err);
console.error('[caught unhandledRejection]:', err.message || '');
Object.keys(err).forEach(function (key) {
console.log('\t'+key+': '+err[key]);
});
console.error(err.stack);
});
process.on('rejectionHandled', function (msg) {

Loading…
Cancel
Save