Handle ECONNRESET errors gracefully as well

cshd
Dragory 2020-10-25 03:49:40 +02:00
parent fec963715c
commit 4decd42294
No known key found for this signature in database
GPG Key ID: 5F387BA66DF8AAC1
1 changed files with 3 additions and 2 deletions

View File

@ -28,9 +28,10 @@ const bot = new Eris.Client(config.token, {
}); });
bot.on("error", err => { bot.on("error", err => {
if (err.code === 1006) { if (err.code === 1006 || err.code === "ECONNRESET") {
// 1006 = "Connection reset by peer" // 1006 = "Connection reset by peer"
// Eris allegedly handles this internally, so we can ignore it // ECONNRESET is similar
// Eris allegedly handles these internally, so we can ignore them
return; return;
} }