mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Removing unreachable catch blocks
This commit is contained in:
parent
8eb8ac0f88
commit
38c541361e
@ -26,14 +26,10 @@ 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); }
|
||||
}
|
||||
else if (typeof msg.payload == "string") {
|
||||
try {
|
||||
parseString(msg.payload, {strict:true,async:true}, function (err, result) {
|
||||
if (err) { node.error(err); }
|
||||
else {
|
||||
@ -42,8 +38,6 @@ module.exports = function(RED) {
|
||||
}
|
||||
});
|
||||
}
|
||||
catch(e) { node.log(e); }
|
||||
}
|
||||
else { node.log("This node only handles xml strings or js objects."); }
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user