node-jenkins-api
node-jenkins-api copied to clipboard
JSON.parse occasionally fails
I occasionally get an exception which appears to be caused by the JSON.parse logic in each get request. I don't know the exact situation on which it occurs, but the test for error or a statusCode of 200 isn't covering the problem I get. Sometimes the error states
Unexpected token <
Other times the error states
Unexpected end of input
For now I've just put a try catch around
In my scenario I'm polling Jenkins every minute and the error generally happens overnight.
I could capture some further information if you would like.