misc.mcserver: add error event to connection and hopefully it stops crashes

This commit is contained in:
Cynthia Foxwell 2024-08-02 12:44:01 -06:00
parent c6083ea062
commit e5f4df6333

View file

@ -149,6 +149,10 @@ function queryServer(ip, port, HANDSHAKE_PACKET) {
} }
}); });
client.on("timeout", function () {}); client.on("timeout", function () {});
client.on("error", function (err) {
logger.verbose("mcserver", "failed:", err);
resolve({error: err});
});
} catch (err) { } catch (err) {
logger.verbose("mcserver", "failed:", err); logger.verbose("mcserver", "failed:", err);
resolve({error: err}); resolve({error: err});