kite ticker websocket was running fine but due to reset of internet connection, I got this exception. Exception occurred HTTPSConnectionPool(host='api.kite.trade', port=443): Max retries exceeded with url: /portfolio/positions (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))
I think it invalidates the socket ticker object.
How do I handle it in python script so to ensure continuity of the script after the internet connection is detected again? Thanks in advance
You have to use try-except block to handle any exception.
But the websocket will close if there's an error.
If you want reconnection,then don't call stop method inside on_close.
Most of the common questions have already been answered.