I am trying to handle the connection break using exception handling.. it shows this error
ConnectionError: HTTPSConnectionPool(host='api.kite.trade', port=443): Max retries exceeded with url: /instruments/NSE (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))
please explain this how can I handle this connection error?
To handle any exception,catch it and then just use try-except block as i showed. In this case,as soon as connection is restrored,it will fetch the instruments dump.
try:
print(kite.instruments('NSE'))
break
except requests.exceptions.ConnectionError:
continue
To handle any exception,catch it and then just use try-except block as i showed. In this case,as soon as connection is restrored,it will fetch the instruments dump.
you can refer this thread
@SRIJAN @Imran