AttributeError for KiteTicker, says object has no attribute 'ws'

gauravmane
I am getting following error while checking whether web socket is connected or not
return self.kite_web_socket.is_connected()
File "/Users/..../lib/python3.7/site-packages/kiteconnect-3.7.6-py3.7.egg/kiteconnect/ticker.py", line 536, in is_connected
if self.ws and self.ws.state == self.ws.STATE_OPEN:
AttributeError: 'KiteTicker' object has no attribute 'ws'
  • sujith
    You can use on_connect callback to do something on connected. You can check out example here.
  • gauravmane
    Thanks Sujith
    I guess the exception was because I was trying to check is_connected() without calling connect() first. But ideally is_connected() should just return me false in this case, shouldn't it?
Sign In or Register to comment.