bugfix: uncaught exception when ws fails or times out handshake

This commit is contained in:
Dave Horton
2022-02-23 14:02:26 -05:00
parent 6f7556981e
commit 6033676f6b

View File

@@ -109,9 +109,11 @@ class WsRequestor extends BaseRequestor {
close() { close() {
this.logger.info('WsRequestor: closing socket'); this.logger.info('WsRequestor: closing socket');
this.ws && this.ws.close(); if (this.ws) {
this.ws.close();
this.ws.removeAllListeners(); this.ws.removeAllListeners();
} }
}
_connect() { _connect() {
assert(!this.ws); assert(!this.ws);