[UPDATE] node-red-contrib-components v0.2.0

node-red-contrib-components Update to v0.2.0

I never announced my stuff here, but since the new version might affect some of your projects, it's probably a good idea to do so.

Components 0.2.0 got some noticeable changes:

  • component context

    Inside a component flow, there now is a msg.component part, that collects all local parameters.
    This context is put on the component's stack and thus preserved when used in nested or recursive scenarios.
    msg.component also has a msg.component._parent part when nested, which is the context of the next outer, parent flow. That makes building recursive structures much easier. There is an example now, too.
  • local / global Parameters

    This is a somewhat breaking change, since the default behaviour of all parameters changes to be local.
    local Parameter (default)
    A local parameter is stored inside the component context, i.e. msg.component. That context is destroyed, when the flow ends (RETURN node). So these parameters only exist in their matching flow.
    global Parameter
    Parameters can be set to "global" in the API now. In that case they are stored inside the msg as they were until now.
    This decision follows the original idea of components to separate concerns and is the point, where components are not another kind of subflow.
  • Broadcast scenario

    If a RETURN node receives a message, that is not originating from its IN node, it will broadcast this message to all connected RUN nodes. That allows components to be a message source.
  • IN-only scenario

    If a component has no RETURN node (a valid way to go), its RUN nodes become a terminating node without an output port. That setup needed some love to make the nodes behave nicely.
  • Examples are there

    I finally managed to add some examples to show the component's features.
  • Fixed Connectivity Validation

    The component nodes try to understand their setup and scan for their matching counter parts. That allows to validate the nodes state. The last versions were messed up somehow and 0.2.0, should now allow decent working.
  • Fixes

    • The scans for matching nodes now handle recursion.
    • README is a little more up-to-date now.

Feedback is very welcome.

cheers
:oliver

3 Likes

throwing an error in a component doesn't interrupt the flow where the component is being called.
The error is raised, and caught by a catch node but it processing continues on 2 paths.

Took me a while before I realized what was going on...

Otherwise cool node to organize flows and make them more readable.

@JoW

FWIW, Node-RED now has the "link-call" node and in V3 it can be called dynamically. It has slightly lesser aims than this node but is still very useful for most scenarios.

1 Like

Thanks,
For the moment I'm bound to 2.x by external parties, but the dynamic part is not really required.
I'll give it a whirl.

Alas, Link in and out show the same behaviour.
The catch node is triggered, but the flow after the link call also continues...

export and post a demo flow. I will show you how to manage this

Already found a way round this. So it's ok.
As usual is the case, I can't reproduce in in a simple example. :grimacing:
I'll see if I can make a simple flow reproducing the case.

This flow illustrates the problem. Notice the catch nodes in Link 1 2 and 3.
The workaround I currently have, is to move the catch in Link 5, and pass some sort of error flag to the calling flow.

[
    {
        "id": "1b2812412742a8cb",
        "type": "tab",
        "label": "Catch problem",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "923b2e9dfb38a316",
        "type": "group",
        "z": "1b2812412742a8cb",
        "name": "Link 2",
        "style": {
            "label": true
        },
        "nodes": [
            "ccc446f46d45f28a",
            "e049a7f95c388573",
            "cc2c2103129848f1",
            "457baf092058b1ef",
            "847da8788ba4fef9",
            "76cdbf62ce20c42f"
        ],
        "env": [],
        "x": 54,
        "y": 539,
        "w": 652,
        "h": 202
    },
    {
        "id": "088ac7bcd6019e7e",
        "type": "group",
        "z": "1b2812412742a8cb",
        "name": "Link 1",
        "style": {
            "label": true
        },
        "nodes": [
            "fcc535195485b47a",
            "e70f52a0de27f030",
            "fcc00b35807e190c",
            "b861af9bb527802f",
            "d9c76c724121923f",
            "33772206bd6af348"
        ],
        "env": [],
        "x": 54,
        "y": 279,
        "w": 652,
        "h": 202
    },
    {
        "id": "6c882c9ce5493fb7",
        "type": "group",
        "z": "1b2812412742a8cb",
        "name": "Link 5",
        "style": {
            "label": true
        },
        "nodes": [
            "9b5cc1d375707c0d",
            "3f3f16eff1d51645",
            "28638e239fa50a88",
            "8c2ca658e077d754"
        ],
        "env": [],
        "x": 854,
        "y": 579,
        "w": 512,
        "h": 142
    },
    {
        "id": "9a57e094c0edc125",
        "type": "group",
        "z": "1b2812412742a8cb",
        "name": "Link 3",
        "style": {
            "label": true
        },
        "nodes": [
            "76408acfa00271f7",
            "058a2513932e98a5",
            "1152f24689e04667",
            "a4e0027cae4884b3",
            "23890abad4e3d50d",
            "f8e6d968ce1de76b"
        ],
        "env": [],
        "x": 54,
        "y": 779,
        "w": 652,
        "h": 202
    },
    {
        "id": "1a008eb88570f6ac",
        "type": "inject",
        "z": "1b2812412742a8cb",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 160,
        "y": 80,
        "wires": [
            [
                "b78a02e232b445e4"
            ]
        ]
    },
    {
        "id": "9b5cc1d375707c0d",
        "type": "link in",
        "z": "1b2812412742a8cb",
        "g": "6c882c9ce5493fb7",
        "name": "Link 5",
        "links": [],
        "x": 895,
        "y": 620,
        "wires": [
            [
                "28638e239fa50a88"
            ]
        ]
    },
    {
        "id": "3f3f16eff1d51645",
        "type": "link out",
        "z": "1b2812412742a8cb",
        "g": "6c882c9ce5493fb7",
        "name": "",
        "mode": "return",
        "links": [],
        "x": 1275,
        "y": 620,
        "wires": []
    },
    {
        "id": "b78a02e232b445e4",
        "type": "link call",
        "z": "1b2812412742a8cb",
        "name": "call Link1",
        "links": [
            "9b5cc1d375707c0d"
        ],
        "timeout": "5",
        "x": 340,
        "y": 80,
        "wires": [
            [
                "0cb8ce01c44b3f52"
            ]
        ]
    },
    {
        "id": "28638e239fa50a88",
        "type": "function",
        "z": "1b2812412742a8cb",
        "g": "6c882c9ce5493fb7",
        "name": "throws error",
        "func": "throw new Error('Some error');\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1030,
        "y": 620,
        "wires": [
            [
                "3f3f16eff1d51645",
                "8c2ca658e077d754"
            ]
        ]
    },
    {
        "id": "8c2ca658e077d754",
        "type": "debug",
        "z": "1b2812412742a8cb",
        "g": "6c882c9ce5493fb7",
        "name": "should not be reached",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1220,
        "y": 680,
        "wires": []
    },
    {
        "id": "0cb8ce01c44b3f52",
        "type": "debug",
        "z": "1b2812412742a8cb",
        "name": "should always be reached (once per inject)",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 630,
        "y": 80,
        "wires": []
    },
    {
        "id": "fcc535195485b47a",
        "type": "debug",
        "z": "1b2812412742a8cb",
        "g": "088ac7bcd6019e7e",
        "name": "should log the error only for link1",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 530,
        "y": 440,
        "wires": []
    },
    {
        "id": "b008f7d237300147",
        "type": "catch",
        "z": "1b2812412742a8cb",
        "name": "",
        "scope": null,
        "uncaught": true,
        "x": 950,
        "y": 100,
        "wires": [
            [
                "7ab3fe35a7f1f578"
            ]
        ]
    },
    {
        "id": "e70f52a0de27f030",
        "type": "link in",
        "z": "1b2812412742a8cb",
        "g": "088ac7bcd6019e7e",
        "name": "Link 1",
        "links": [],
        "x": 95,
        "y": 380,
        "wires": [
            [
                "b861af9bb527802f"
            ]
        ]
    },
    {
        "id": "fcc00b35807e190c",
        "type": "link out",
        "z": "1b2812412742a8cb",
        "g": "088ac7bcd6019e7e",
        "name": "",
        "mode": "return",
        "links": [],
        "x": 555,
        "y": 380,
        "wires": []
    },
    {
        "id": "b861af9bb527802f",
        "type": "link call",
        "z": "1b2812412742a8cb",
        "g": "088ac7bcd6019e7e",
        "name": "call link 2",
        "links": [
            "9b5cc1d375707c0d"
        ],
        "timeout": "5",
        "x": 200,
        "y": 380,
        "wires": [
            [
                "d9c76c724121923f",
                "fcc00b35807e190c"
            ]
        ]
    },
    {
        "id": "d9c76c724121923f",
        "type": "debug",
        "z": "1b2812412742a8cb",
        "g": "088ac7bcd6019e7e",
        "name": "should not be reached",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 420,
        "y": 320,
        "wires": []
    },
    {
        "id": "33772206bd6af348",
        "type": "catch",
        "z": "1b2812412742a8cb",
        "g": "088ac7bcd6019e7e",
        "name": "",
        "scope": [
            "b861af9bb527802f"
        ],
        "uncaught": false,
        "x": 270,
        "y": 440,
        "wires": [
            [
                "fcc00b35807e190c",
                "fcc535195485b47a"
            ]
        ]
    },
    {
        "id": "7ab3fe35a7f1f578",
        "type": "debug",
        "z": "1b2812412742a8cb",
        "name": "Don't want any here",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 1180,
        "y": 100,
        "wires": []
    },
    {
        "id": "ccc446f46d45f28a",
        "type": "debug",
        "z": "1b2812412742a8cb",
        "g": "923b2e9dfb38a316",
        "name": "should log the error only for link2",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 530,
        "y": 700,
        "wires": []
    },
    {
        "id": "e049a7f95c388573",
        "type": "link in",
        "z": "1b2812412742a8cb",
        "g": "923b2e9dfb38a316",
        "name": "Link 2",
        "links": [],
        "x": 95,
        "y": 640,
        "wires": [
            [
                "457baf092058b1ef"
            ]
        ]
    },
    {
        "id": "cc2c2103129848f1",
        "type": "link out",
        "z": "1b2812412742a8cb",
        "g": "923b2e9dfb38a316",
        "name": "",
        "mode": "return",
        "links": [],
        "x": 595,
        "y": 640,
        "wires": []
    },
    {
        "id": "457baf092058b1ef",
        "type": "link call",
        "z": "1b2812412742a8cb",
        "g": "923b2e9dfb38a316",
        "name": "call link 2 bis",
        "links": [
            "9b5cc1d375707c0d"
        ],
        "timeout": "5",
        "x": 210,
        "y": 640,
        "wires": [
            [
                "cc2c2103129848f1",
                "847da8788ba4fef9"
            ]
        ]
    },
    {
        "id": "847da8788ba4fef9",
        "type": "debug",
        "z": "1b2812412742a8cb",
        "g": "923b2e9dfb38a316",
        "name": "should not be reached",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 420,
        "y": 580,
        "wires": []
    },
    {
        "id": "76cdbf62ce20c42f",
        "type": "catch",
        "z": "1b2812412742a8cb",
        "g": "923b2e9dfb38a316",
        "name": "",
        "scope": [
            "457baf092058b1ef",
            "28638e239fa50a88"
        ],
        "uncaught": false,
        "x": 270,
        "y": 700,
        "wires": [
            [
                "cc2c2103129848f1",
                "ccc446f46d45f28a"
            ]
        ]
    },
    {
        "id": "9370809d651f562e",
        "type": "inject",
        "z": "1b2812412742a8cb",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 160,
        "y": 220,
        "wires": [
            [
                "81f70d2f600144a7"
            ]
        ]
    },
    {
        "id": "81f70d2f600144a7",
        "type": "link call",
        "z": "1b2812412742a8cb",
        "name": "call Link3",
        "links": [
            "058a2513932e98a5"
        ],
        "timeout": "5",
        "x": 340,
        "y": 220,
        "wires": [
            [
                "f7496a368d862bfd"
            ]
        ]
    },
    {
        "id": "f7496a368d862bfd",
        "type": "debug",
        "z": "1b2812412742a8cb",
        "name": "should always be reached (once per inject)",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 630,
        "y": 220,
        "wires": []
    },
    {
        "id": "d7c50ec3590389b6",
        "type": "inject",
        "z": "1b2812412742a8cb",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 160,
        "y": 160,
        "wires": [
            [
                "63956fefaf736376"
            ]
        ]
    },
    {
        "id": "63956fefaf736376",
        "type": "link call",
        "z": "1b2812412742a8cb",
        "name": "call Link2",
        "links": [
            "e049a7f95c388573"
        ],
        "timeout": "5",
        "x": 340,
        "y": 160,
        "wires": [
            [
                "518bd8d386fee80b"
            ]
        ]
    },
    {
        "id": "518bd8d386fee80b",
        "type": "debug",
        "z": "1b2812412742a8cb",
        "name": "should always be reached (once per inject)",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 630,
        "y": 160,
        "wires": []
    },
    {
        "id": "76408acfa00271f7",
        "type": "debug",
        "z": "1b2812412742a8cb",
        "g": "9a57e094c0edc125",
        "name": "should log the error only for link3",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 530,
        "y": 940,
        "wires": []
    },
    {
        "id": "058a2513932e98a5",
        "type": "link in",
        "z": "1b2812412742a8cb",
        "g": "9a57e094c0edc125",
        "name": "Link 3",
        "links": [],
        "x": 95,
        "y": 880,
        "wires": [
            [
                "a4e0027cae4884b3"
            ]
        ]
    },
    {
        "id": "1152f24689e04667",
        "type": "link out",
        "z": "1b2812412742a8cb",
        "g": "9a57e094c0edc125",
        "name": "",
        "mode": "return",
        "links": [],
        "x": 595,
        "y": 880,
        "wires": []
    },
    {
        "id": "a4e0027cae4884b3",
        "type": "link call",
        "z": "1b2812412742a8cb",
        "g": "9a57e094c0edc125",
        "name": "call link 2 tris",
        "links": [
            "9b5cc1d375707c0d"
        ],
        "timeout": "5",
        "x": 210,
        "y": 880,
        "wires": [
            [
                "1152f24689e04667",
                "23890abad4e3d50d"
            ]
        ]
    },
    {
        "id": "23890abad4e3d50d",
        "type": "debug",
        "z": "1b2812412742a8cb",
        "g": "9a57e094c0edc125",
        "name": "should not be reached",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 420,
        "y": 820,
        "wires": []
    },
    {
        "id": "f8e6d968ce1de76b",
        "type": "catch",
        "z": "1b2812412742a8cb",
        "g": "9a57e094c0edc125",
        "name": "",
        "scope": [
            "28638e239fa50a88",
            "a4e0027cae4884b3"
        ],
        "uncaught": false,
        "x": 270,
        "y": 940,
        "wires": [
            [
                "1152f24689e04667",
                "76408acfa00271f7"
            ]
        ]
    }
]

That is how it was designed to work. What you are are asking is not possible because in the runtime the link in ~ link out is not aware of the nodes in between and cannot control them and prevent them outputting errors to the internal error routing of a flow.

Here is how I would approach it.

[{"id":"1a008eb88570f6ac","type":"inject","z":"1b2812412742a8cb","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":80,"wires":[["b78a02e232b445e4"]]},{"id":"b78a02e232b445e4","type":"link call","z":"1b2812412742a8cb","name":"","links":["9b5cc1d375707c0d"],"linkType":"static","timeout":"5","x":330,"y":80,"wires":[["07c28b3b39a1128b"]]},{"id":"0cb8ce01c44b3f52","type":"debug","z":"1b2812412742a8cb","name":"should always be reached (once per inject)","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":810,"y":100,"wires":[]},{"id":"7ab3fe35a7f1f578","type":"debug","z":"1b2812412742a8cb","name":"Don't want any here","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1220,"y":440,"wires":[]},{"id":"9370809d651f562e","type":"inject","z":"1b2812412742a8cb","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":220,"wires":[["81f70d2f600144a7"]]},{"id":"81f70d2f600144a7","type":"link call","z":"1b2812412742a8cb","name":"","links":["e049a7f95c388573"],"linkType":"static","timeout":"5","x":330,"y":220,"wires":[["f7496a368d862bfd"]]},{"id":"f7496a368d862bfd","type":"debug","z":"1b2812412742a8cb","name":"should always be reached (once per inject)","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":630,"y":220,"wires":[]},{"id":"d7c50ec3590389b6","type":"inject","z":"1b2812412742a8cb","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":160,"wires":[["63956fefaf736376"]]},{"id":"63956fefaf736376","type":"link call","z":"1b2812412742a8cb","name":"","links":["f3a987bbd5d5938d"],"linkType":"static","timeout":"5","x":330,"y":160,"wires":[["518bd8d386fee80b"]]},{"id":"518bd8d386fee80b","type":"debug","z":"1b2812412742a8cb","name":"should always be reached (once per inject)","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":630,"y":160,"wires":[]},{"id":"b008f7d237300147","type":"catch","z":"1b2812412742a8cb","name":"","scope":null,"uncaught":true,"x":990,"y":440,"wires":[["7ab3fe35a7f1f578"]]},{"id":"07c28b3b39a1128b","type":"switch","z":"1b2812412742a8cb","name":"No error?","property":"error","propertyType":"msg","rules":[{"t":"empty"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":500,"y":80,"wires":[["0cb8ce01c44b3f52","c81f6688d8e54b86"],["0cb8ce01c44b3f52"]]},{"id":"c81f6688d8e54b86","type":"debug","z":"1b2812412742a8cb","name":"Success (no error)","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":730,"y":60,"wires":[]},{"id":"923b2e9dfb38a316","type":"group","z":"1b2812412742a8cb","name":"Link 2","style":{"label":true},"nodes":["e049a7f95c388573","cc2c2103129848f1","457baf092058b1ef","847da8788ba4fef9","3667b0e3fba2d510","176dc17a70758438"],"x":64,"y":539,"w":662,"h":162},{"id":"e049a7f95c388573","type":"link in","z":"1b2812412742a8cb","g":"923b2e9dfb38a316","name":"Link 2","links":[],"x":105,"y":580,"wires":[["457baf092058b1ef"]]},{"id":"cc2c2103129848f1","type":"link out","z":"1b2812412742a8cb","g":"923b2e9dfb38a316","name":"","mode":"return","links":[],"x":665,"y":660,"wires":[]},{"id":"457baf092058b1ef","type":"link call","z":"1b2812412742a8cb","g":"923b2e9dfb38a316","name":"","links":["9b5cc1d375707c0d"],"linkType":"static","timeout":"5","x":170,"y":660,"wires":[["cc2c2103129848f1","3667b0e3fba2d510"]]},{"id":"847da8788ba4fef9","type":"debug","z":"1b2812412742a8cb","g":"923b2e9dfb38a316","name":"should not be reached","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":580,"y":580,"wires":[]},{"id":"3667b0e3fba2d510","type":"switch","z":"1b2812412742a8cb","g":"923b2e9dfb38a316","name":"No error?","property":"error","propertyType":"msg","rules":[{"t":"empty"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":310,"y":580,"wires":[["847da8788ba4fef9"],["176dc17a70758438"]]},{"id":"176dc17a70758438","type":"debug","z":"1b2812412742a8cb","g":"923b2e9dfb38a316","name":"should log the error only for link3","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":550,"y":620,"wires":[]},{"id":"6c882c9ce5493fb7","type":"group","z":"1b2812412742a8cb","name":"Link 5","style":{"label":true},"nodes":["9b5cc1d375707c0d","3f3f16eff1d51645","28638e239fa50a88","ac426dd08bc7f6e8","e03928c33719ad48"],"x":914,"y":539,"w":462,"h":142},{"id":"9b5cc1d375707c0d","type":"link in","z":"1b2812412742a8cb","g":"6c882c9ce5493fb7","name":"Link 5","links":[],"x":990,"y":640,"wires":[["28638e239fa50a88"]],"l":true},{"id":"3f3f16eff1d51645","type":"link out","z":"1b2812412742a8cb","g":"6c882c9ce5493fb7","name":"","mode":"return","links":[],"x":1335,"y":640,"wires":[]},{"id":"28638e239fa50a88","type":"function","z":"1b2812412742a8cb","g":"6c882c9ce5493fb7","name":"throws error","func":"throw new Error('Some error');    \nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1150,"y":640,"wires":[["3f3f16eff1d51645"]]},{"id":"ac426dd08bc7f6e8","type":"catch","z":"1b2812412742a8cb","g":"6c882c9ce5493fb7","name":"","scope":["28638e239fa50a88"],"uncaught":false,"x":1000,"y":580,"wires":[["e03928c33719ad48"]]},{"id":"e03928c33719ad48","type":"change","z":"1b2812412742a8cb","g":"6c882c9ce5493fb7","name":"","rules":[{"t":"set","p":"error","pt":"msg","to":"error","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1160,"y":580,"wires":[["3f3f16eff1d51645"]]},{"id":"4e9d0b76ecceb614","type":"group","z":"1b2812412742a8cb","name":"Link 2","style":{"label":true},"nodes":["f3a987bbd5d5938d","46ac9a08e0a076b4","f86c626f45f0043f","768eb24481667303","2fd0a2d69ee1a2db","ded4cdeb345c3272"],"x":64,"y":319,"w":662,"h":162},{"id":"f3a987bbd5d5938d","type":"link in","z":"1b2812412742a8cb","g":"4e9d0b76ecceb614","name":"Link 1","links":[],"x":105,"y":360,"wires":[["f86c626f45f0043f"]]},{"id":"46ac9a08e0a076b4","type":"link out","z":"1b2812412742a8cb","g":"4e9d0b76ecceb614","name":"","mode":"return","links":[],"x":665,"y":440,"wires":[]},{"id":"f86c626f45f0043f","type":"link call","z":"1b2812412742a8cb","g":"4e9d0b76ecceb614","name":"","links":["9b5cc1d375707c0d"],"linkType":"static","timeout":"5","x":170,"y":440,"wires":[["46ac9a08e0a076b4","2fd0a2d69ee1a2db"]]},{"id":"768eb24481667303","type":"debug","z":"1b2812412742a8cb","g":"4e9d0b76ecceb614","name":"should not be reached","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":580,"y":360,"wires":[]},{"id":"2fd0a2d69ee1a2db","type":"switch","z":"1b2812412742a8cb","g":"4e9d0b76ecceb614","name":"No error?","property":"error","propertyType":"msg","rules":[{"t":"empty"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":310,"y":360,"wires":[["768eb24481667303"],["ded4cdeb345c3272"]]},{"id":"ded4cdeb345c3272","type":"debug","z":"1b2812412742a8cb","g":"4e9d0b76ecceb614","name":"should log the error only for link2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":550,"y":400,"wires":[]}]

Thanks.
That is more or less what I did.

And to make this detour to Link Out/ Link In back relevant to Components:

You can use the same logic with components.

Yeah. My apologies to the OP for the detour.

Hey JoW,
thanks for reporting!
Can you provide your example flow json , so I can reproduce, plz?

I will try to find some time in the next weeks to work on a fix.

Cheers
:ollix

1 Like

Here's a flow showing the issue with components.
I don't know much about what's possible, but I could image a drop down property on a 'Use Comp' node selecting an optional Catch node for handling errors for that call.

[
    {
        "id": "51e9347e2ea80de1",
        "type": "tab",
        "label": "Flow 6",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "b31ab68fef841887",
        "type": "inject",
        "z": "51e9347e2ea80de1",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 120,
        "y": 200,
        "wires": [
            [
                "0519e353029893b1"
            ]
        ]
    },
    {
        "id": "c89a92d44d91b737",
        "type": "component_in",
        "z": "51e9347e2ea80de1",
        "name": "myComponent",
        "api": [],
        "usecontext": true,
        "x": 220,
        "y": 280,
        "wires": [
            [
                "671c96b9ae396017"
            ]
        ]
    },
    {
        "id": "d5391a4c3059b611",
        "type": "component_out",
        "z": "51e9347e2ea80de1",
        "name": null,
        "mode": "default",
        "component_definitions_are_NOT_allowed_inside_subflows": false,
        "x": 720,
        "y": 280,
        "wires": []
    },
    {
        "id": "0519e353029893b1",
        "type": "component",
        "z": "51e9347e2ea80de1",
        "name": "Run myComponent",
        "targetComponent": null,
        "targetComponentId": "c89a92d44d91b737",
        "paramSources": {},
        "statuz": "",
        "statuzType": "str",
        "outputs": 1,
        "outLabels": [
            "default"
        ],
        "x": 380,
        "y": 200,
        "wires": [
            [
                "8469408c6eb65b2d"
            ]
        ]
    },
    {
        "id": "27a63f0e63a7f671",
        "type": "catch",
        "z": "51e9347e2ea80de1",
        "name": "Catch for call to myComponent",
        "scope": [
            "0519e353029893b1"
        ],
        "uncaught": false,
        "x": 330,
        "y": 140,
        "wires": [
            [
                "82fadbf3ce30994b"
            ]
        ]
    },
    {
        "id": "8469408c6eb65b2d",
        "type": "debug",
        "z": "51e9347e2ea80de1",
        "name": "Don't want to get here",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 670,
        "y": 200,
        "wires": []
    },
    {
        "id": "671c96b9ae396017",
        "type": "function",
        "z": "51e9347e2ea80de1",
        "name": "",
        "func": "throw new Error('Some error');\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 470,
        "y": 280,
        "wires": [
            [
                "d5391a4c3059b611"
            ]
        ]
    },
    {
        "id": "82fadbf3ce30994b",
        "type": "debug",
        "z": "51e9347e2ea80de1",
        "name": "This one should report the error",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 640,
        "y": 140,
        "wires": []
    },
    {
        "id": "115cd22073c84617",
        "type": "catch",
        "z": "51e9347e2ea80de1",
        "name": "Catch All unhandled",
        "scope": null,
        "uncaught": true,
        "x": 360,
        "y": 80,
        "wires": [
            [
                "c1888544b11376b1"
            ]
        ]
    },
    {
        "id": "c1888544b11376b1",
        "type": "debug",
        "z": "51e9347e2ea80de1",
        "name": "Don't want any here",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 670,
        "y": 80,
        "wires": []
    }
]