Closed
Description
This might cause some friction for anyone updating but I wanted to make it as obvious & clear as possible, to avoid the risk of anyone missing useful error events after upgrading. Trying to consume "error" events from the WebsocketClient now gives a type error:

const wsClient = new WebsocketClient();
wsClient.on('error', (data) => {
console.error('ws exception: ', data);
});
This is expected, as of version v4.0.0 of the bybit-api
Node.js/JavaScript/TypeScript SDK for Bybit's REST APIs and WebSockets. Emitting an error event was intended to communicate when issues happen, but had the unintended consequence of throwing unhandled exceptions, since the emitted errors are not Error
instances.
As of v4.0.0, you should listen to the "exception" event instead to monitor any potential issues within your usage of the SDK's WebsocketClient:
const wsClient = new WebsocketClient();
wsClient.on('exception', (data) => {
console.error('ws exception: ', data);
});