In light of recent events, I think I have found a big cause for the machine dieing.
Variables.
Though painfully obvious to those in the know, it isn't for me.
const device_name = global.get('myDeviceName');
node.warn(" Device name " + device_name);
const flow_name_ = flow.get("name");
node.warn("Flow name " + flow_name);
msg.topic ="ERROR_REPORT/" + device_name + "/" + flow_name;
return msg;
My suspicion is the const
rather than let
.
As the device_name and flow_name are not going to change, after reading the new stuff on how to use let
and const
(though it used to be var
for the first one) why is it creating errors?
Ok, I've changed it from const
to let
and it is still creating errors: hand over fist.
Any elephants I'm missing?
ARGH!
The missing _
at the end of the name for flow_name_
in the second last line!
(I'm an idiot!)
RESOLVED!