Hello
I encountered a rather strange situation, I don't know if this is normal or if there is a problem in the func-exec.
In other words, I expected the func-exec to generate an error, not to crash the NodeRed. Someone more skilled could enlighten me.
I am attaching a piece of code that generates an error, along with an "equivalent" code that does not generate an error.
[{"id":"a7788d31.9c8a4","type":"func-exec","z":"eb9c06b5.a867d8","name":"Crash NodeRed","func":"var cmd = \"anything\";\n\nvar exec = child_process.exec(cmd, (error, stdout, stderr) => \n{ \n var time = stdout.split('anything');\n time = time[1].split('anything'); // This Line Generate NodeRed Crash\n\n callback(msg);\n});","outputs":1,"noerr":0,"x":640,"y":120,"wires":[["fb8bd387.5dbfe"]]},{"id":"8e535db.0e5732","type":"inject","z":"eb9c06b5.a867d8","name":"Go","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":450,"y":120,"wires":[["a7788d31.9c8a4"]]},{"id":"fb8bd387.5dbfe","type":"debug","z":"eb9c06b5.a867d8","name":"Result 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":840,"y":120,"wires":[]},{"id":"fe91c7bf.15507","type":"inject","z":"eb9c06b5.a867d8","name":"Go","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":450,"y":200,"wires":[["6a37fb93.a03484"]]},{"id":"46b8c649.555af","type":"debug","z":"eb9c06b5.a867d8","name":"Result 2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":840,"y":200,"wires":[]},{"id":"6a37fb93.a03484","type":"function","z":"eb9c06b5.a867d8","name":"No Crash","func":"var time = 'anything'.split('anything');\ntime = time[1].split('anything');\n\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":640,"y":200,"wires":[["46b8c649.555af"]]}]