1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Added Quick catch for gross deploy errors... (only reports in console log... no UI notification)

This commit is contained in:
Dave C-J 2013-09-13 17:23:23 +01:00
parent 36ae1dd0ef
commit 88eb2cddc2

View File

@ -66,7 +66,7 @@ var registry = (function() {
events.emit("nodes-stopped");
nodes = {};
},
addLogHandler: function(handler) {
logHandlers.push(handler);
}
@ -87,7 +87,7 @@ var node_type_registry = (function() {
var obj = {
register: function(type,node) {
util.inherits(node, Node);
var callerFilename = getCallerFilename(type);
if (callerFilename == null) {
util.log("["+type+"] unable to determine filename");
@ -115,7 +115,7 @@ var node_type_registry = (function() {
result += node_configs[nt];
}
return result;
}
}
return obj;
@ -253,9 +253,9 @@ module.exports.load = function() {
}
});
}
loadNodes("nodes");
events.emit("nodes-loaded");
}
@ -265,22 +265,27 @@ module.exports.getNode = function(nid) {
return registry.get(nid);
}
module.exports.parseConfig = function(conf) {
registry.clear();
events.emit("nodes-starting");
for (var i in conf) {
var nn = null;
var nt = node_type_registry.get(conf[i].type);
if (nt) {
nn = new nt(conf[i]);
try {
nn = new nt(conf[i]);
}
catch (err) {
util.log("[red] "+conf[i].type+" : "+err);
}
}
// console.log(nn);
if (nn == null) {
util.log("[red] unknown type: "+conf[i].type);
}
}
// Clean up any orphaned credentials
var deletedCredentials = false;
for (var c in credentials) {
@ -296,4 +301,3 @@ module.exports.parseConfig = function(conf) {
events.emit("nodes-started");
}