# Stop and error broken?

**URL:** <https://community.n8n.io/t/stop-and-error-broken/40580>\
**Category:** Questions\
**Created:** [February 20, 2024, 7:18pm UTC](https://community.n8n.io/t/stop-and-error-broken/40580 "2024-02-20T19:18:59Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mike99](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/mike99/32/26566_2.png) [@mike99](https://community.n8n.io/u/mike99)\
**Post date:** [February 20, 2024, 7:18pm UTC](https://community.n8n.io/t/stop-and-error-broken/40580/1 "2024-02-20T19:18:59Z")

</div>

Hi,

I tried “Stop And Error” in both the docker and manual install and I have the same behaver on both. When trying to use Stop And Error, I get the following error in the node.

```auto
NodeOperationError: An error as occured!
    at Object.execute (/usr/lib/node_modules/n8n/node_modules/n8n-nodes-base/nodes/StopAndError/StopAndError.node.ts:101:9)
    at Workflow.runNode (/usr/lib/node_modules/n8n/node_modules/n8n-workflow/src/Workflow.ts:1332:31)
    at /usr/lib/node_modules/n8n/node_modules/n8n-core/src/WorkflowExecute.ts:1046:44
    at /usr/lib/node_modules/n8n/node_modules/n8n-core/src/WorkflowExecute.ts:1722:11

```

Even the node alone, not linked to anything, return the same error in the output. Am I missing something ? The node seems pretty straightforward to me.

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [February 21, 2024, 3:24pm UTC](https://community.n8n.io/t/stop-and-error-broken/40580/2 "2024-02-21T15:24:01Z")

</div>

Hey @mike99,

It appears to be working for me, What version of n8n are you using and can you share a workflow that reproduces the issue?

---

<div class="post-metadata">

**Author:** ![mike99](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/mike99/32/26566_2.png) [@mike99](https://community.n8n.io/u/mike99)\
**Post date:** [February 21, 2024, 9:03pm UTC](https://community.n8n.io/t/stop-and-error-broken/40580/3 "2024-02-21T21:03:44Z")

</div>

Finally, I figured out it’s just not what I expected. That it’s use to make the workflow fail on purpose while I wanted to return an error to a webhook. Still, the Details section output really seems to contain an error.

I tried version is 1.27.2 and I just upgraded to 1.29.1 to make sure.

And if I look at the Details section on the output:

```auto
NodeOperationError: bar not foo
   at Object.execute (/usr/lib/node_modules/n8n/node_modules/n8n-nodes-base/nodes/StopAndError/StopAndError.node.ts:101:9)
   at Workflow.runNode (/usr/lib/node_modules/n8n/node_modules/n8n-workflow/src/Workflow.ts:1374:31)
   at /usr/lib/node_modules/n8n/node_modules/n8n-core/src/WorkflowExecute.ts:1049:44
   at /usr/lib/node_modules/n8n/node_modules/n8n-core/src/WorkflowExecute.ts:1725:11

```

---

<div class="post-metadata">

**Author:** ![liam](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/liam/32/34968_2.png) [@liam](https://community.n8n.io/u/liam)\
**Post date:** [February 21, 2024, 11:11pm UTC](https://community.n8n.io/t/stop-and-error-broken/40580/4 "2024-02-21T23:11:44Z")

</div>

@mike99 When you want to return errors to a webhook you use the “Respond to webhook” node and set a custom status code. You need set the webhook trigger to respond with the “Respond to webhook” node before it works.

The status code for bad request from the client (sender of webhook) is 400 and for error in the workflow is 500. You can see a list of http [error code meanings here](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status).

When I make callable API style workflows I typically make them callable from http and other workflows directly, so i use both respond to webhook and stop and error so I can always handle errors “on the other side”

I also like to use a code node to make an array of input parameter errors to return. It makes it much easier to trouble shoot when you know what fields have errors. You can see an actual implementation of that in my workflow [here](http://community.n8n.io/t/zoho-calendar-community-node/40525/2).

I also return a schema with parameter fail errors. That is also in the workflow i linked above.

Hope that helps!

---

<div class="post-metadata">

**Author:** ![mike99](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/mike99/32/26566_2.png) [@mike99](https://community.n8n.io/u/mike99)\
**Post date:** [February 22, 2024, 9:02pm UTC](https://community.n8n.io/t/stop-and-error-broken/40580/5 "2024-02-22T21:02:59Z")

</div>

Thanks a lot Liam, this is really appreciated.

I know that I had to answer with a 400 errors but was looking a way to do it and seems like I didn’t dig enough the Respond to webhook node. I will give it a try.

Thanks again, really appreciated.

---

<div class="post-metadata">

**Author:** ![liam](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/liam/32/34968_2.png) [@liam](https://community.n8n.io/u/liam)\
**Post date:** [February 22, 2024, 11:03pm UTC](https://community.n8n.io/t/stop-and-error-broken/40580/6 "2024-02-22T23:03:34Z")

</div>

You’re very welcome!

Another thing I forgot to mention, a great thing about the stop and error node is that you can try it again in the execution.  
So if you send any 500 errors back its nice to have a stop and error too so you can rerun the failed node after making fixes!

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/system/32/195824_2.png) [@system](https://community.n8n.io/u/system)\
**Post date:** [February 29, 2024, 11:03pm UTC](https://community.n8n.io/t/stop-and-error-broken/40580/7 "2024-02-29T23:03:52Z")

</div>

Closed on February 29, 2024, 11:03pm UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
