Closed EvertDekker closed 2 years ago
Hi @EvertDekker, Hmmm not sure what kind of data to log.
Bart
Hi Bart, Thanks for your reply.
`var counter = 0;
node.bindings.forEach(function (binding, index) {
if (getNestedProperty(msg, binding.bindSource) !== undefined) {
counter++;
}
else {
node.error(binding.bindSource + " is a unspecified binding Source.")
}
});
node.attributeBasedBindings.forEach(function (binding, index) {
if (getNestedProperty(msg, binding) !== undefined) {
counter++;
}
else {
node.error(binding + " is a unspecified binding.")
}
});
if (counter === 0) {
node.error("None of the specified bindings fields (in the config screen or data-bind-text or data-bind-values) are available in this message.");
msg.payload = null;
}`
- Message ID, i'm not sure if that help. Have to look if there's a way to trace back the message then.
In that case you need to add (temporarily) a debug message, to display your SVG node's input messages:
When I log those message id's, you can look in your debug sidebar panel, to see about which message the error log is talking.
- Can be a option, but same problem as no.1
Yes but in this case it is optionally available. You only activate it when you want to troubleshoot something, like you are trying to do currently...
- No idea if this is possible, just a thought.
The node.error
wouldn't work because that is server-side available only. But I get your point.
However in this case you could get a LOT of useless logging. Suppose e.g. you have 10 bindings, and an input message contains one of those binding fields. But in that case you would get 10 - 1 = 9 log lines for all bindings which don't correspond to a field in the input msg...
Hi Bart, Clear, thanks for the explanation of all pros and cons. Then I think that option 2, message Id is the most logic solution.
regards, evert
@EvertDekker, Can you please install the node from Github, and let me know if option is enough to troubleshoot your issue? From within your .node-red folder:
npm install bartbutenaers/node-red-contrib-ui-svg
Evert, The option with the message id's in the error messages has been published as version 2.3.1. See point 5 of the troubleshooting section for an example. Please reopen this issue when this is not sufficient to solve your problem.
Bart,
Sorry, missed your previous post. Thanks for adding the request to your Nr node.
Hi Evert, No problem. Don't hesitate to reopen if this solution is not sufficient!
Hi Bart, Thanks again for you amazing NR nodes.
When reloading a SVG page I get (sometimes) 1 or more error's None of the specified bindings fields (in the config screen or data-bind-text or data-bind-values) are available in this message. I understand what the error means, but during reloading of the svg page there are send 20+ message's to the svg node to refresh everything. Then is not clear to me what messages will give the error.
Request: Can you add some more info to the error, for example what message or binding field give the error?