Handle error 1006 (Connection reset by peer) gracefully

cshd
Dragory 2020-10-21 21:41:38 +03:00
parent 012bd5b9b2
commit ccd56a1d88
No known key found for this signature in database
GPG Key ID: 5F387BA66DF8AAC1
1 changed files with 10 additions and 0 deletions

View File

@ -27,6 +27,16 @@ const bot = new Eris.Client(config.token, {
}, },
}); });
bot.on("error", err => {
if (err.code === 1006) {
// 1006 = "Connection reset by peer"
// Eris allegedly handles this internally, so we can ignore it
return;
}
throw err;
});
/** /**
* @type {Eris.Client} * @type {Eris.Client}
*/ */