Closed dennisnotojr closed 6 years ago
Here is the code where node.error only has one param
function processResponse(err, body, node, msg, config) { if (err !== null && body === null) { node.error(err); node.status({ fill: 'red', shape: 'ring', text: 'call to watson conversation service failed' }); return; } msg.payload = body;
if (config.context) {
if (config.multiuser && msg.user) {
node.context().flow.set('context-' + msg.user, body.context);
} else {
if (msg.user) {
node.warn('msg.user ignored when multiple users not set in node');
}
node.context().flow.set('context', body.context);
}
}
node.send(msg);
node.status({});
}
Here is the code to fix the problem is processResponse. Made a copy of your project and tested the code fix and catch works with this mod.
node.error(err, msg);
Thanks for this spot. I will try and wrap into the next code drop.
Implemented in 0.5.14
Released
After testing errors with the WCS node, I have concluded that the catch node can't be used due to the fact that node.error is being called with just one param. node.error needs to be called with two params for the catch node to work. This probably effects the others Watson nodes as well.
Here's Nick Oleary's comment on another node that doesn't trigger the catch node.
"the node is calling node.error("message") which causes it to get logged, but is not also passing in the offending msg object which is needed to trigger the Catch node"