From 4decd4229420b8a2979ef80f20e5593b070f4a55 Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Sun, 25 Oct 2020 03:49:40 +0200 Subject: [PATCH] Handle ECONNRESET errors gracefully as well --- src/bot.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/bot.js b/src/bot.js index 4293f89..628c8d2 100644 --- a/src/bot.js +++ b/src/bot.js @@ -28,9 +28,10 @@ const bot = new Eris.Client(config.token, { }); bot.on("error", err => { - if (err.code === 1006) { + if (err.code === 1006 || err.code === "ECONNRESET") { // 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; }