mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Add some more error handlers for custom node label functions
Closes #956
This commit is contained in:
parent
42f4e0fa86
commit
e6b5552cba
@ -138,7 +138,12 @@ RED.deploy = (function() {
|
|||||||
}
|
}
|
||||||
var label = "";
|
var label = "";
|
||||||
if (typeof node._def.label == "function") {
|
if (typeof node._def.label == "function") {
|
||||||
|
try {
|
||||||
label = node._def.label.call(node);
|
label = node._def.label.call(node);
|
||||||
|
} catch(err) {
|
||||||
|
console.log("Definition error: "+node_def.type+".label",err);
|
||||||
|
label = node_def.type;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
label = node._def.label;
|
label = node._def.label;
|
||||||
}
|
}
|
||||||
|
@ -133,7 +133,13 @@ RED.sidebar.config = (function() {
|
|||||||
nodes.forEach(function(node) {
|
nodes.forEach(function(node) {
|
||||||
var label = "";
|
var label = "";
|
||||||
if (typeof node._def.label == "function") {
|
if (typeof node._def.label == "function") {
|
||||||
|
try {
|
||||||
label = node._def.label.call(node);
|
label = node._def.label.call(node);
|
||||||
|
} catch(err) {
|
||||||
|
console.log("Definition error: "+node_def.type+".label",err);
|
||||||
|
label = node_def.type;
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
label = node._def.label;
|
label = node._def.label;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user