From 21b54005762689424db1c82283f83be4cc37e5ce Mon Sep 17 00:00:00 2001 From: Miikka Virtanen Date: Wed, 20 Sep 2017 09:46:11 +0300 Subject: [PATCH] Don't display full stack traces for network errors They pointed to Eris internals anyway, and are pretty unreadable. --- src/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index 4677d8c..20aa678 100644 --- a/src/index.js +++ b/src/index.js @@ -19,8 +19,8 @@ const messageQueue = new Queue(); // Force crash on unhandled rejections (use something like forever/pm2 to restart) process.on('unhandledRejection', err => { - if (err instanceof utils.BotError) { - // BotErrors don't need a stack trace + if (err instanceof utils.BotError || (err && err.code)) { + // We ignore stack traces for BotErrors (the message has enough info) and network errors from Eris (their stack traces are unreadably long) console.error(`Error: ${err.message}`); } else { console.error(err);