# Flow continues after sqlite throws error

**URL:** <https://discourse.nodered.org/t/flow-continues-after-sqlite-throws-error/52398>\
**Category:** General\
**Created:** [19 October 2021 08:14 UTC](https://discourse.nodered.org/t/flow-continues-after-sqlite-throws-error/52398 "2021-10-19T08:14:20Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![r0ller](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/r0ller/32/14327_2.png) [@r0ller](https://discourse.nodered.org/u/r0ller)\
**Post date:** [19 October 2021 08:14 UTC](https://discourse.nodered.org/t/flow-continues-after-sqlite-throws-error/52398/1 "2021-10-19T08:14:20Z")

</div>

Hi All,

Accidentally, I managed to send a malformed sql statement to an sqlite node in a subflow which threw an error that got of course caught by the parent level catch node. What I did not expect was that the subflow continued executing after the sqlite node threw that error.

I checked the outcoming msg from the sqlite and surprisingly it does not even contain any hint if there's an error or not. How can I check it in the subflow then? Of course checking back the db is an option.

Thanks,  
r0ller

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [19 October 2021 08:27 UTC](https://discourse.nodered.org/t/flow-continues-after-sqlite-throws-error/52398/2 "2021-10-19T08:27:25Z")

</div>

Did you set the debug node showing what is coming out of the node to show Full Message and check there was not anything in any other properties?  
What do you see in msg.payload in that debug?

---

<div class="post-metadata">

**Author:** ![r0ller](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/r0ller/32/14327_2.png) [@r0ller](https://discourse.nodered.org/u/r0ller)\
**Post date:** [19 October 2021 08:29 UTC](https://discourse.nodered.org/t/flow-continues-after-sqlite-throws-error/52398/3 "2021-10-19T08:29:24Z")

</div>

Yepp, I checked the complete msg object and there's no property at all that'd give a hint about the error. The payload is an empty array since the statement is an sql insert.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [19 October 2021 09:04 UTC](https://discourse.nodered.org/t/flow-continues-after-sqlite-throws-error/52398/4 "2021-10-19T09:04:56Z")

</div>

1. What version of NR and node.js? (you can get this from the start up log)
2. can you put a small example together demonstrating the issue? (table syntax also)

---

<div class="post-metadata">

**Author:** ![r0ller](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/r0ller/32/14327_2.png) [@r0ller](https://discourse.nodered.org/u/r0ller)\
**Post date:** [19 October 2021 09:08 UTC](https://discourse.nodered.org/t/flow-continues-after-sqlite-throws-error/52398/5 "2021-10-19T09:08:37Z")

</div>

I need a few more minutes investigating the stuff. It may be a problem at our side.

---

<div class="post-metadata">

**Author:** ![r0ller](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/r0ller/32/14327_2.png) [@r0ller](https://discourse.nodered.org/u/r0ller)\
**Post date:** [19 October 2021 09:15 UTC](https://discourse.nodered.org/t/flow-continues-after-sqlite-throws-error/52398/6 "2021-10-19T09:15:57Z")

</div>

False alarm. Sorry for the noise. The issue was that for whatever reasons the code sent the same sql statement twice: once via the async node.send(msg) and at the end via return msg as well. I got rid of the async send and now the subflow stops after throwing the error.

Sorry again and thanks for your help!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [2 November 2021 09:16 UTC](https://discourse.nodered.org/t/flow-continues-after-sqlite-throws-error/52398/7 "2021-11-02T09:16:54Z")

</div>

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