mirror of
https://github.com/aljazceru/bitfinex-api-py.git
synced 2025-12-19 14:54:21 +01:00
Add handling for <20051 : Stop/Restart Websocket Server (please reconnect)>.
This commit is contained in:
@@ -107,6 +107,8 @@ class BfxWebsocketClient(object):
|
|||||||
raise OutdatedClientVersion(f"Mismatch between the client version and the server version. " +
|
raise OutdatedClientVersion(f"Mismatch between the client version and the server version. " +
|
||||||
f"Update the library to the latest version to continue (client version: {BfxWebsocketClient.VERSION}, " +
|
f"Update the library to the latest version to continue (client version: {BfxWebsocketClient.VERSION}, " +
|
||||||
f"server version: {message['version']}).")
|
f"server version: {message['version']}).")
|
||||||
|
elif isinstance(message, dict) and message["event"] == "info" and message["code"] == 20051:
|
||||||
|
raise websockets.ConnectionClosedError(rcvd=None, sent=None)
|
||||||
elif isinstance(message, dict) and message["event"] == "auth":
|
elif isinstance(message, dict) and message["event"] == "auth":
|
||||||
if message["status"] == "OK":
|
if message["status"] == "OK":
|
||||||
self.event_emitter.emit("authenticated", message); self.authentication = True
|
self.event_emitter.emit("authenticated", message); self.authentication = True
|
||||||
|
|||||||
Reference in New Issue
Block a user