From e5f4df63336332870bf413e1388acf7f663216b0 Mon Sep 17 00:00:00 2001 From: Cynthia Foxwell Date: Fri, 2 Aug 2024 12:44:01 -0600 Subject: [PATCH] misc.mcserver: add error event to connection and hopefully it stops crashes --- src/modules/misc/mcserver.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/modules/misc/mcserver.js b/src/modules/misc/mcserver.js index 741e0d7..c5987ee 100644 --- a/src/modules/misc/mcserver.js +++ b/src/modules/misc/mcserver.js @@ -149,6 +149,10 @@ function queryServer(ip, port, HANDSHAKE_PACKET) { } }); client.on("timeout", function () {}); + client.on("error", function (err) { + logger.verbose("mcserver", "failed:", err); + resolve({error: err}); + }); } catch (err) { logger.verbose("mcserver", "failed:", err); resolve({error: err});