Having some trouble with my node-red crashing several times a day. I suspect that one of the issues may be related to an http request I am making.
I'm trying to retrieve JSON data from a webpage, but sometimes I encounter errors in the log indicating HTML instead. It seems like there might be an issue on the server side of the webpage causing this error, leading to problems in my flow.
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
Is there any way for me to adjust my functions to filter out these errors and prevent node-red from crashing?
Here's a snippet of the function I'm using to parse the JSON:
datarequest = JSON.parse(msg.payload);
msg1 = {};
msg1.payload = datarequest.data.valvesetat.bypass;
return [msg1];