diff --git a/nodes/core/parsers/70-XML.js b/nodes/core/parsers/70-XML.js index c30b0e933..931de7f58 100644 --- a/nodes/core/parsers/70-XML.js +++ b/nodes/core/parsers/70-XML.js @@ -26,23 +26,17 @@ module.exports = function(RED) { this.on("input", function(msg) { if (msg.hasOwnProperty("payload")) { if (typeof msg.payload == "object") { - try { - msg.payload = builder.buildObject(msg.payload); - node.send(msg); - } - catch(e) { node.log(e); } + msg.payload = builder.buildObject(msg.payload); + node.send(msg); } else if (typeof msg.payload == "string") { - try { - parseString(msg.payload, {strict:true,async:true}, function (err, result) { - if (err) { node.error(err); } - else { - msg.payload = result; - node.send(msg); - } - }); - } - catch(e) { node.log(e); } + parseString(msg.payload, {strict:true,async:true}, function (err, result) { + if (err) { node.error(err); } + else { + msg.payload = result; + node.send(msg); + } + }); } else { node.log("This node only handles xml strings or js objects."); } }