Skip to content

Group catch-all is depended on node insertion into group #5811

Description

@gorenje

Current Behavior

From Forum

Image

The function nodes are generating exceptions and the catch 1 nodes are receiving those exceptions respectively (i.e. the catch: 1 at the top catches the function 22 errors and the catch: 1 at the bottom catches the error of function 1).

The catch all in group node has the "Ignore errors handled by other Catch nodes" set in both cases meaning that since the exception is actually being handled by the catch: 1 node, then it shouldn't be receiving the exceptions. This is happening in the top group but not in the bottom group - why?

Ordering.

The bottom group was created with the catch-all node being the first exception handler in the group, the catch: 1 (for that group) was added after the catch-all node. In the top group, the order was reversed: I added the catch: 1 node to the group before adding the catch-all node.

As I said, this is an edge case that can be fixed by re-adding the catch-all node to a group once all catch-1 nodes have been added. Just have to remember to do this every time a catch-1 node is added to a group ....

I don't know whether the flow attached will maintain the error when imported but if someone can confirm, that would be great.

Expected Behavior

In the bottom group, the catch-all in group should not be catching the exception generated by the function node.

Steps To Reproduce

  1. import flow attached here
  2. click the inject node button in the top group
  3. click the inject node button in the bottom group

Example flow

[{"id":"eb24c92ce5621760","type":"tab","label":"[catch] catch all in group except those handler elsewhere","disabled":false,"info":"","env":[]},{"id":"5ea70f167d125afc","type":"group","z":"eb24c92ce5621760","style":{"stroke":"#999999","stroke-opacity":"1","fill":"none","fill-opacity":"1","label":true,"label-position":"nw","color":"#a4a4a4"},"nodes":["a703aaba38a383b9","3bf38b22cdb0fa95","98023732b523561f","e846b7ff5f8f635f","350a6ead2834e85e","4897c7a025a41050"],"x":407.85716247558594,"y":525.8214364051819,"w":736.1428375244141,"h":271.46425199508667},{"id":"5ba8388e749dfa77","type":"group","z":"eb24c92ce5621760","style":{"stroke":"#999999","stroke-opacity":"1","fill":"none","fill-opacity":"1","label":true,"label-position":"nw","color":"#a4a4a4"},"nodes":["023f10b500483121","bdf2557e7fc7b76f","a884ccb2f0fe0dad","76653802ad661faa","4baaef89afb5cb20","13095e53a4e7d7fc"],"x":402,"y":855,"w":773,"h":227},{"id":"a703aaba38a383b9","type":"function","z":"eb24c92ce5621760","g":"5ea70f167d125afc","name":"function 22","func":"node.wrnd(\"dd\")\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1012.4285736083984,"y":756.2856884002686,"wires":[[]]},{"id":"3bf38b22cdb0fa95","type":"inject","z":"eb24c92ce5621760","g":"5ea70f167d125afc","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":605.2857666015625,"y":756.2856884002686,"wires":[["a703aaba38a383b9"]]},{"id":"98023732b523561f","type":"catch","z":"eb24c92ce5621760","g":"5ea70f167d125afc","name":"","scope":["a703aaba38a383b9"],"uncaught":false,"x":1012.4285736083984,"y":703.4285936355591,"wires":[["350a6ead2834e85e"]]},{"id":"e846b7ff5f8f635f","type":"catch","z":"eb24c92ce5621760","g":"5ea70f167d125afc","name":"catch all in group except those already dealt with","scope":"group","uncaught":true,"x":613.8571624755859,"y":566.8214364051819,"wires":[["4897c7a025a41050"]]},{"id":"023f10b500483121","type":"catch","z":"eb24c92ce5621760","g":"5ba8388e749dfa77","name":"catch all in group except those already dealt with","scope":"group","uncaught":true,"x":608,"y":908,"wires":[["bdf2557e7fc7b76f"]]},{"id":"bdf2557e7fc7b76f","type":"debug","z":"eb24c92ce5621760","g":"5ba8388e749dfa77","name":"debug 1","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"","statusType":"counter","x":947,"y":896,"wires":[]},{"id":"a884ccb2f0fe0dad","type":"function","z":"eb24c92ce5621760","g":"5ba8388e749dfa77","name":"function 1","func":"node.wrnd(\"dd\")\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1035.999984741211,"y":1041,"wires":[[]]},{"id":"76653802ad661faa","type":"inject","z":"eb24c92ce5621760","g":"5ba8388e749dfa77","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":628.857177734375,"y":1041,"wires":[["a884ccb2f0fe0dad"]]},{"id":"4baaef89afb5cb20","type":"catch","z":"eb24c92ce5621760","g":"5ba8388e749dfa77","name":"","scope":["a884ccb2f0fe0dad"],"uncaught":false,"x":938,"y":1000,"wires":[["13095e53a4e7d7fc"]]},{"id":"13095e53a4e7d7fc","type":"debug","z":"eb24c92ce5621760","g":"5ba8388e749dfa77","name":"debug 2","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"","statusType":"counter","x":1069,"y":935,"wires":[]},{"id":"350a6ead2834e85e","type":"debug","z":"eb24c92ce5621760","g":"5ea70f167d125afc","name":"debug 3","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"","statusType":"counter","x":1038,"y":636,"wires":[]},{"id":"4897c7a025a41050","type":"debug","z":"eb24c92ce5621760","g":"5ea70f167d125afc","name":"debug 4","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"","statusType":"counter","x":962,"y":567,"wires":[]}]

Environment

  • Node-RED version: 4.0.9 & NR 5.0.0
  • Node.js version: as in Docker 4.0.9 & 5.0.0
  • npm version: as in Docker 4.0.9 & 5.0.0
  • Platform/OS: as in Docker 4.0.9 & 5.0.0
  • Browser: Firefox
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions