Node-RED: How to Catch and Log Errors from Node-RED Nodes

This documentation is part of the Getting Started guide. You can view the complete guide here: How to Get Started with Node-RED.

Welcome to the Stackhero documentation

Stackhero offers a fully managed Node-RED cloud environment designed to help you build workflows quickly:

  • Integrated MQTT server (Mosquitto) for seamless IoT integration.
  • Full access to the Node-RED admin interface for managing your flows and settings.
  • Node-RED Dashboard included for real-time visualisation.
  • Dedicated SMTP email server included, with no sending limits.
  • Effortless one-click updates to keep your instance up to date.
  • Custom domain names with automatic HTTPS: for example, https://node-red.your-company.com.
  • High performance and enhanced security thanks to private, dedicated infrastructure.

You can have a secure, production-ready Node-RED cloud hosting instance running in around 5 minutes. Stackhero takes care of installation, updates, and infrastructure, so you can focus on building your automations.

At times, nodes may generate errors. A practical solution is to set up a "catch all debug" flow to monitor these errors.

Example of a Node-RED error catch flowExample of a Node-RED error catch flow

To set this up, add a catch node and connect it to a debug node. Configure the debug node to output the complete msg object. This setup logs each error generated in the flow to the Node-RED debug window.

Example of a Node-RED node error caughtExample of a Node-RED node error caught

A catch node is only triggered by errors from nodes within the same flow. If you use multiple flows (or tabs), you will need to add the catch and debug nodes to each flow.