From 98d3dcc5325f43dfa205697be4498bd17fea44b6 Mon Sep 17 00:00:00 2001 From: Matt Date: Sat, 15 Mar 2014 17:50:10 -0600 Subject: [PATCH] Added log error for socket error --- lib/pool.js | 4 ++-- lib/stratum.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/pool.js b/lib/pool.js index 2f6609a..3ea61ca 100644 --- a/lib/pool.js +++ b/lib/pool.js @@ -365,8 +365,8 @@ var pool = module.exports = function pool(options, authorizeFn){ }).on('malformedMessage', function (message) { emitWarningLog('client', client.workerName + " has sent us a malformed message: " + message); - }).on('socketError', function() { - emitWarningLog('client', client.workerName + " has somehow had a socket error"); + }).on('socketError', function(err) { + emitWarningLog('client', client.workerName + " has somehow had a socket error: " + JSON.stringify(err)); }).on('socketDisconnect', function() { emitLog('client', "Client '" + client.workerName + "' disconnected!"); }).on('unknownStratumMethod', function(fullMessage) { diff --git a/lib/stratum.js b/lib/stratum.js index 7084f9d..08723ef 100644 --- a/lib/stratum.js +++ b/lib/stratum.js @@ -221,7 +221,7 @@ var StratumClient = function(options){ if (err.code === 'ECONNRESET') _this.emit('socketDisconnect') else - _this.emit('socketError'); + _this.emit('socketError', err); }); }