title: Throwing errors with stopping the flow in Node-RED
body: <p>I have a very simple flow: One inject node, and two function nodes.
  In the first function I have the following code: </p>
  
  <pre><code>node.error("test",msg);
  return msg;
  </code></pre>
  
  <p>And in the second:</p>
  
  <pre><code>node.warn("this shouldn't be printed");
  return msg;
  </code></pre>
  
  <p>The <a href="https://nodered.org/docs/creating-nodes/node-js#handling-errors" rel="nofollow noreferrer">documentation</a> says:</p>
  
  <blockquote>
    <p>If the node encounters an error that should halt the current flow, it should log the event with the <code>this.error</code> function.</p>
  </blockquote>
  
  <p>But both messages show up on the debug panel from the GUI of node-red, meaning the flow does not halt.
  What am I doing wrong?</p>