My node-red is crashing multiple times per day. One of the problems I think that may be the cause is an http request I am doing.
I am requesting the output of a webpage in JSON. But sometimes I see in the log that returns an error in HTML. There is probably something wrong on the webpage serverside, but my flow is erroring out on this.
SyntaxError: undefined:1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> ^ Unexpected token <
2 Jan 15:26:26 - [error] [function:Filter temperatures] SyntaxError: undefined:1
Can I edit my functions to be able to filter this out, and hopefully not crash node-red any more?
This is an example of a function I am using to parse the JSON.
datarequest = JSON.parse(msg.payload);
msg1 = {};
msg1.payload = datarequest.data.valvesetat.bypass;
return [msg1];