Fix log message & hopefully handle client socket errors better

This commit is contained in:
Bryan Ashby 2019-04-08 20:14:00 -06:00
parent 64de10cbf7
commit 19e70d1c78
No known key found for this signature in database
GPG Key ID: B49EB437951D2542
1 changed files with 5 additions and 1 deletions

View File

@ -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 => {