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