From 19e70d1c781129a27b05c4472516e96e286e849d Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Mon, 8 Apr 2019 20:14:00 -0600 Subject: [PATCH] Fix log message & hopefully handle client socket errors better --- core/login_server_module.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/login_server_module.js b/core/login_server_module.js index 041f317c..a08abfe9 100644 --- a/core/login_server_module.js +++ b/core/login_server_module.js @@ -40,6 +40,10 @@ module.exports = class LoginServerModule extends ServerModule { } handleNewClient(client, clientSock, modInfo) { + clientSock.on('error', err => { + logger.log.warn({ modInfo, error : err.message }, 'Client socket error'); + }); + // // Start tracking the client. A session ID aka client ID // will be established in addNewClient() below. @@ -68,7 +72,7 @@ module.exports = class LoginServerModule extends ServerModule { }); client.on('error', err => { - logger.log.info({ clientId : client.session.id }, 'Connection error: %s' % err.message); + logger.log.info({ clientId : client.session.id, error : err.message }, 'Connection error'); }); client.on('close', err => {