diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f4247c..c82d18f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ # Changelog +## v2.0.1 - 2023-02-22 + +### Updated +- Fixed WebSocket onClose event issue + ## v2.0.0 - 2023-01-31 ### Updated diff --git a/package-lock.json b/package-lock.json index 473a586..94c4dee 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@binance/connector", - "version": "2.0.0", + "version": "2.0.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@binance/connector", - "version": "2.0.0", + "version": "2.0.1", "license": "MIT", "dependencies": { "axios": "^0.27.2", diff --git a/package.json b/package.json index d76ea83..3d933a3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@binance/connector", - "version": "2.0.0", + "version": "2.0.1", "description": "This is a lightweight library that works as a connector to the Binance public API.", "main": "src/index.js", "scripts": { diff --git a/src/modules/websocket.js b/src/modules/websocket.js index bdde791..ca75503 100644 --- a/src/modules/websocket.js +++ b/src/modules/websocket.js @@ -289,7 +289,8 @@ const Websocket = superclass => class extends superclass { ws.on('close', (closeEventCode, reason) => { if (!wsRef.closeInitiated) { - this.logger.error(`Connection close due to ${closeEventCode}: ${reason}.`) + callbacks.close && callbacks.close() + this.logger.warn(`Connection close due to ${closeEventCode}: ${reason}.`) setTimeout(() => { this.logger.debug('Reconnect to the server.') initConnect()