Don't display full stack traces for network errors
They pointed to Eris internals anyway, and are pretty unreadable.master
parent
8426e7b170
commit
21b5400576
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue