Catching errors using a catch node

You can catch errors thrown by nodes and handle them in a separate flow.

  1. Open Node-RED.
  2. Add a catch node from the input category to the workspace.
  3. NOTICE

    notice

    A catch node can only catch errors on the same tab. If an error is thrown in a subflow and there is no [apiname]catch[/apiname] node present in that subflow, then the error is propagated upwards to the flow containing the subflow.

  4. Double-click the catch node to open the Edit node dialogue.
  5. In the drop-down list Catch errors from, select whether the node shall catch errors from all nodes on the tab or only from selected nodes.
  6. If you chose selected nodes, click the check boxes to select the nodes whose errors you want to catch.
  7. Click Done to apply your changes.
  8. Add more nodes to the workspace and connect them to a flow with the catch node being the first node.
  1. Once you deploy the flow, the catch node injects a message containing error information into the flow, whenever an error is thrown by any of the monitored nodes.