From da68c102cd3527c9b09d28e72718a2ebf8010304 Mon Sep 17 00:00:00 2001 From: tigerbot Date: Fri, 11 Aug 2017 18:25:34 -0600 Subject: [PATCH] stop double printing uncaught error stacks --- boot/worker.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/boot/worker.js b/boot/worker.js index 3b1223a..78167de 100644 --- a/boot/worker.js +++ b/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) {