I have had a few problems recently and it is the routine that has bitten me on the b*m.
And typically it is the error routine which is at fault.
To try and catch the error, and find the problem I separated the two parts and now want to inject a control signal to simulate the error.
(Actually)
Skip to bottom it may be more important.
This is a test error message I want to inject:
{"message":"ReferenceError: a is not defined (line 1, col 19)","source":{"id":"c552872d.7f144","type":"function","name":"This will throw an error","count":1}}
Cut from the debug
node.
I am trying to set up a function
node to inject it but I can't get it working.
I know it is stupid me not understanding how to do it, but . . . . .
When I put it in an inject
node then pass it to a function
node, I generate infinite errors.
(If it is actually in the flow)
Could someone help me find the elephant?
[{"id":"39bbd9ef.ce813e","type":"function","z":"accbdb61.d75918","name":"","func":"msg = {\"message\":\"ReferenceError: a is not defined (line 1, col 19)\",\"source\":{\"id\":\"c552872d.7f144\",\"type\":\"function\",\"name\":\"This will throw an error\",\"count\":1}}\nreturn msg;","outputs":1,"noerr":0,"x":630,"y":230,"wires":[[]]},{"id":"96ab98ce.848a8","type":"inject","z":"accbdb61.d75918","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":480,"y":230,"wires":[["39bbd9ef.ce813e"]]}]
All that aside:
The underlying problem is that I am trying to catch errors.
When I do, usually (maybe originally) it worked.
By doing something innocent I have messed things up.
I can't catch the errors now because when I catch them, that in itself causes an error.
Thus: run away errors.
How can I catch the errors if doing that generates errors itself?
I can post that part of the flow if you want.