From 14882bda7831bb15edfaded4c541511aa3971c1e Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Fri, 29 Jun 2018 11:49:39 +0100 Subject: [PATCH] Ensure runtime errors in Change node can be caught Fixes #1769 --- nodes/core/logic/15-change.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nodes/core/logic/15-change.js b/nodes/core/logic/15-change.js index c7c05118e..ab4f59cc3 100644 --- a/nodes/core/logic/15-change.js +++ b/nodes/core/logic/15-change.js @@ -123,7 +123,7 @@ module.exports = function(RED) { try{ value = RED.util.evaluateJSONataExpression(rule.to,msg); } catch(err) { - node.error(RED._("change.errors.invalid-expr",{error:err.message})); + node.error(RED._("change.errors.invalid-expr",{error:err.message}),msg); return; } } @@ -150,11 +150,11 @@ module.exports = function(RED) { fromRE = new RegExp(fromRE, "g"); } catch (e) { valid = false; - node.error(RED._("change.errors.invalid-from",{error:e.message})); + node.error(RED._("change.errors.invalid-from",{error:e.message}),msg); return; } } else { - node.error(RED._("change.errors.invalid-from",{error:"unsupported type: "+(typeof fromValue)})); + node.error(RED._("change.errors.invalid-from",{error:"unsupported type: "+(typeof fromValue)}),msg); return } } else {