Only to not flood the forum with too many topics.
Taking on what Nic told me, I have made this test flow.
It isn't too complicated.
Pressing either timestamp
node the message goes through. Dummy message.
Pressing either error
node makes the subflow throw an error - or so I hope.
But ..... although it does, I am not understanding why the catch
node isn't seeing it.
All I get are messages (see picture) which are ok, but the question remains: why isn't the catch
node catching the errors?
I hope the screen shot helps you understand.
There is nothing shown in the Error
debug node's output.
The names in the error messages are set in the subflow
environment variable tab.
[{"id":"6093ac68.4d618c","type":"subflow","name":"Subflow 1","info":"","in":[{"x":180,"y":200,"wires":[{"id":"e32780f4.c61eb"}]}],"out":[{"x":490,"y":200,"wires":[{"id":"e32780f4.c61eb","port":0}]}]},{"id":"e32780f4.c61eb","type":"function","z":"6093ac68.4d618c","name":"","func":"var name = env.get(\"name\");\n\nif (msg.payload == \"error\")\n{\n node.error(name);\n return null;\n}\n\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":330,"y":200,"wires":[[]]},{"id":"bf601604.73ebf8","type":"subflow:6093ac68.4d618c","z":"88de1ac2.8b8c38","name":"one","env":[{"name":"name","value":"one","type":"str"}],"x":380,"y":1390,"wires":[["984aaa45.8d36"]]},{"id":"3cb871d3.9af3be","type":"inject","z":"88de1ac2.8b8c38","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":220,"y":1390,"wires":[["bf601604.73ebf8"]]},{"id":"984aaa45.8d36","type":"debug","z":"88de1ac2.8b8c38","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":580,"y":1390,"wires":[]},{"id":"2f3bd436.8abd04","type":"subflow:6093ac68.4d618c","z":"88de1ac2.8b8c38","name":"two","env":[{"name":"name","value":"two","type":"str"}],"x":380,"y":1500,"wires":[["c76ebc4d.4419e8"]]},{"id":"efd8925d.383ed8","type":"inject","z":"88de1ac2.8b8c38","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":220,"y":1500,"wires":[["2f3bd436.8abd04"]]},{"id":"c76ebc4d.4419e8","type":"debug","z":"88de1ac2.8b8c38","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":580,"y":1500,"wires":[]},{"id":"a4ced8ae.a3189","type":"inject","z":"88de1ac2.8b8c38","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"error","payloadType":"str","x":210,"y":1360,"wires":[["bf601604.73ebf8"]]},{"id":"6b97b36e.4f92c4","type":"inject","z":"88de1ac2.8b8c38","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"error","payloadType":"str","x":210,"y":1470,"wires":[["2f3bd436.8abd04"]]},{"id":"de6f1e4b.a26be","type":"catch","z":"88de1ac2.8b8c38","name":"","scope":null,"uncaught":false,"x":390,"y":1600,"wires":[["9c9c3c31.a55628"]]},{"id":"9c9c3c31.a55628","type":"debug","z":"88de1ac2.8b8c38","name":"Error","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":580,"y":1600,"wires":[]}]