WebsocketClient.on("error") event throws type error "Argument of type '(data: any) => void' is not assignable to parameter of type 'never'" #413
Labels
documentation
Improvements or additions to documentation
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:
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 notError
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:
The text was updated successfully, but these errors were encountered: