Don't display full stack traces for network errors

They pointed to Eris internals anyway, and are pretty unreadable.
master
Miikka Virtanen 2017-09-20 09:46:11 +03:00
parent 8426e7b170
commit 21b5400576
1 changed files with 2 additions and 2 deletions

View File

@ -19,8 +19,8 @@ const messageQueue = new Queue();
// Force crash on unhandled rejections (use something like forever/pm2 to restart) // Force crash on unhandled rejections (use something like forever/pm2 to restart)
process.on('unhandledRejection', err => { process.on('unhandledRejection', err => {
if (err instanceof utils.BotError) { if (err instanceof utils.BotError || (err && err.code)) {
// BotErrors don't need a stack trace // 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}`); console.error(`Error: ${err.message}`);
} else { } else {
console.error(err); console.error(err);