-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
crash during error handling #2228
Comments
The second argument of |
I know, that's the next issue I will create |
This was referenced Jul 10, 2019
knolleary
added a commit
that referenced
this issue
Aug 12, 2019
Have pushed a fix to |
This was referenced Sep 30, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What are the steps to reproduce?
Use the following nodes :
Instead of "OPC UA Subscribe" any node can be used which calls node.error() with a string for the parameter msg:
What happens?
node-red crashes with the following call-stack:
What do you expect to happen?
An error should be sent as message to the "catch" node, because the OPC UA connection cannot be established.
Part of the problem lies in the function handleError() from packages/node_modules/@node-red/runtime/lib/nodes/flows/Flow.js which expects, that 'msg' is of type object, but in this case it is a string and therefore the last line causes the crash :
I would either just ignore msg if it is not of type object:
or check if 'msg' is of type string and then create errorMessage as an object instead of using redUtil.cloneMessage(msg), but even then an 'else' for all other datatypes should be used.
I know that this is "just" a robustness issue, because 'msg' should not be of type string, but the fix is easy and the OPC UA Node is probably not the only one which does it wrong.
Please tell us about your environment:
The text was updated successfully, but these errors were encountered: