Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure errors in preDeliver callback are handled #3911

Merged
merged 3 commits into from Feb 21, 2023
Merged

Conversation

knolleary
Copy link
Member

Fixes #3848

If, for any reason, there is an error whilst delivering a message to a node, rather than cause a fatal error, it will now get logged as follows. You get the full node path, its type and the stack of the error.

    4 Oct 15:18:12 - [error] Error handling message: node:d5771324312036f6/dd93c1103d5aee6e [function]
    4 Oct 15:18:12 - [error] TypeError: sendEvent.destination.node.receive is not a function
        at Immediate._onImmediate (/Users/nol/code/node-red/node-red/packages/node_modules/@node-red/runtime/lib/flows/Flow.js:832:56)
        at processImmediate (node:internal/timers:464:21)

@coveralls
Copy link

coveralls commented Oct 4, 2022

Coverage Status

Coverage decreased (-0.02%) to 68.301% when pulling 742f05f on protect-hooks into 93c1600 on master.

@knolleary knolleary added this to the 3.1 milestone Nov 7, 2022
Co-authored-by: Stephen McLaughlin <44235289+Steve-Mcl@users.noreply.github.com>
@knolleary knolleary merged commit 6044871 into master Feb 21, 2023
@zhimsel
Copy link

zhimsel commented Oct 24, 2023

I'm encountering the error this PR addresses, however, the node ID is undefined for me:

"Error delivering message to node:undefined [undefined]"

TypeError: sendEvent.destination.node.receive is not a function
    at deliverMessageToDestination (/usr/src/node-red/node_modules/@node-red/runtime/lib/flows/Flow.js:799:40)
    at Immediate._onImmediate (/usr/src/node-red/node_modules/@node-red/runtime/lib/flows/Flow.js:815:21)
    at processImmediate (node:internal/timers:466:21)

I've disabled a few contrib nodes that I don't use, but that didn't prevent the error (which is sort of expected, since they were unused.

Any thoughts? Not sure how to trace down which node is causing this...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Node Red crashing with sendEvent.destination.node.receive
4 participants