The problematic line is:
logResponse = logResponse.substring(j,logResponse.length());
I think in substring while I am checking length,it is returning -1,
String index out of range: -1 is the error.
Could you please tell me what does it mean(length returning -1) and how to handle it and throw proper exception.