# Should the catch node be able to catch warnings?

**URL:** <https://discourse.nodered.org/t/should-the-catch-node-be-able-to-catch-warnings/101163>\
**Category:** Core Development\
**Created:** [31 May 2026 16:22 UTC](https://discourse.nodered.org/t/should-the-catch-node-be-able-to-catch-warnings/101163 "2026-05-31T16:22:33Z")\
**Posts on this page:** 1\
**Showing post:** 17

<div class="post-metadata">

**Author:** ![gregorius](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gregorius/32/73816_2.png) [@gregorius](https://discourse.nodered.org/u/gregorius)\
**Post date:** [1 June 2026 20:51 UTC](https://discourse.nodered.org/t/should-the-catch-node-be-able-to-catch-warnings/101163/17 "2026-06-01T20:51:15Z")

</div>

> [@gregorius](#):
>
> what a node that can generally consume debug messages? Something like the status node that consumes status messages of other nodes?

Fyi, I created a quick capture node --\> [capture debug](https://flows.nodered.org/node/@gregoriusrippenstein/node-red-capture-debug) node. It generates a msg for each debug message generated. It also implements some basic logic to avoid endless loops if a debug node is attached to it.

![Screen Recording 2026-06-01 at 22.46.13](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/4/141095392069d67b52781b3c18083735999cfee8.gif)

As shown, it also captures error and info messages in the debug.

How does it do this?

The core of the node is this:

```javascript
module.exports = function(RED) {
  function Corecapture_debugFunctionality(config) {
    RED.nodes.createNode(this,config);

    var node = this;
    var cfg = config;

    var handler = (msg) => {
      if (msg.topic != "debug") { return }
      
      if (!msg.data || typeof msg.data != "object") { return }
      // ignore any debug messages generated by debug nodes directly connected
      // to this node else endless loops are created. 
      if (node.wires[0].indexOf(msg.data.id) > -1) { return }

      if ( msg.data.format == "Object") {
        let d = JSON.parse(msg.data.msg)
        if (d._capturedebug) { return }
      }
      
      if (msg.topic == "debug" && ( (msg.data && !msg.data._capturedebug) || !msg._capturedebug )) {
        node.send({
          _capturedebug: node.id,
          _msgid: RED.util.generateId(),          
          debug: msg.data
        })
      }
    }

    require("@node-red/util").events.on('comms', handler)

    node.on('close', function() {
      require("@node-red/util").events.off("comms", handler)
    });
  }
  RED.nodes.registerType("capture-debug", Corecapture_debugFunctionality);
}

```

---

_[View the full topic](https://discourse.nodered.org/t/should-the-catch-node-be-able-to-catch-warnings/101163)._
