python-binance
python-binance copied to clipboard
How to handle ThreadedWebsocketManager exceptions
Describe the bug when connection drops for some reason, i receive the exception on the black screen but i can't catch it.
To Reproduce turn of your wifi while running ThreadedWebsocketManager socket stream.
How can I handle this kind of exceptions so that my script restarts after receiving this exception. I think this is related to the threading.
I have the same issues - when there's an error, the docs say that the manager will call the callback with an error message. It doesn't call the callback again and just keeps running. I don't even receive an exception.
There's some issue running the websockets manager inside docker(official python image) and doesn't report any problem it just keep running forever
i dont think we are having the same issue guys. When the below code comes to an error, it will show the error on the screen but i can't catch it to handle it if i wrap it with a try except
bm = ThreadedWebsocketManager(API_KEY, API_SECRET) bm.start() bm.start_kline_socket(callback=handle_socket_message, symbol=symbol, interval=Client.KLINE_INTERVAL_5MINUTE)
Same issue here. When running ThreadedWebsocketManager
, if I turn off the internet, I get a websocket 1006 error logged on the screen, but there is no error message sent to the callback, so it's impossible to catch the error in order to reset the socket. Then, when I turn on the internet, the socket thread is already killed and it does not reconnect anymore.
Any workaround for this problem?
Still any update?