Log more errors to node
There are some catch blocks that only contain commentedr messages.
My assumption is those are commented so the debug log is not spammed with messages if the device is sleeping.
It would be helpfull when debugging errors when other errors would still surface.
Ther error messages I saw when the device was sleeping contained all EHOSTUNREACH not sure how reliable that is throug.
But a possible filter could look like this:
catch (error) {
if (!error?.toString().includes("EHOSTUNREACH") ?? false) {
node.warn("Installing webhook failed " + error);
node.status({ fill: "red", shape: "ring", text: "Installing webhook failed " }
}
}
I would prefer a config flag where you can enable or disable verbose logging.
I have it the other way around, that to much is logged.
I have a Shelly that is far away from my wifi APs, so I get many "timeout of 5000ms exceeded".
So yea, agree with Windkh , some flag to control the logging would be nice. Or that it is possible to catch with the node-red catch node.
Another way between could be to only ignore connection errors, but not errors that happen in the logic. So when API gets changed again (hopefully not) it will log errors, but not if a device is not reachable for whatever reason.
I will do that on a cold snowy winter evening