aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHolden Rohrer <hr@hrhr.dev>2020-07-16 12:32:03 -0400
committerHolden Rohrer <hr@hrhr.dev>2020-07-16 12:32:03 -0400
commitb7df60369e35df143dc26a024a1ed0b4038c1889 (patch)
tree613064c58e935cb6ad137388bf78df9a07b4b291
parent85f90046ad23292f683bb199c6a0087a6464a2a3 (diff)
made websocket errors log more specifically
-rw-r--r--socket.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/socket.js b/socket.js
index 4563ed5..e49cd28 100644
--- a/socket.js
+++ b/socket.js
@@ -19,8 +19,8 @@ class retryws extends EventEmitter{ // a wrapper on ws that retries on failure
function sockinit(){ // addr is not expected to change, so not handed as input; similarly, sock is not passed in a chain because behavior is expected to be serial (either initializing or retrying)
sock = new ws(addr);
sock.on('open', () => { sockdown = false; self.emit('open'); });
- sock.on('close', (err) => { console.log(err); setTimeout(sockinit,1000); sockdown = true; self.emit('close'); });
- sock.on('error', (err) => { console.log(err); sock.close(); });
+ sock.on('close', (err) => { console.log('close', err); setTimeout(sockinit,1000); sockdown = true; self.emit('close'); });
+ sock.on('error', (err) => { console.log('error', err); sock.close(); });
sock.on('message', (message) => { self.emit('message',message);});
}
sockinit();