I get this error sometimes(very rare though, but still happens couple of times a day, and this crashes my server). Like the trace shows, this happens when I'm trying to get historical data minute wise of some day java.lang.IllegalStateException: closed at okio.RealBufferedSource.rangeEquals(RealBufferedSource.java:407) at okio.RealBufferedSource.rangeEquals(RealBufferedSource.java:401) at okhttp3.internal.Util.bomAwareCharset(Util.java:471) at okhttp3.ResponseBody.string(ResponseBody.java:175) at com.zerodhatech.kiteconnect.kitehttp.KiteResponseHandler.handle(KiteResponseHandler.java:24) at com.zerodhatech.kiteconnect.kitehttp.KiteRequestHandler.getRequest(KiteRequestHandler.java:69) at com.zerodhatech.kiteconnect.KiteConnect.getHistoricalData(KiteConnect.java:733)
You can catch the exception and retry.