From b7df60369e35df143dc26a024a1ed0b4038c1889 Mon Sep 17 00:00:00 2001 From: Holden Rohrer Date: Thu, 16 Jul 2020 12:32:03 -0400 Subject: made websocket errors log more specifically --- socket.js | 4 ++-- 1 file 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(); -- cgit