Add node.error handling to core nodes

This commit is contained in:
Nick O'Leary
2015-03-16 13:58:01 +00:00
parent 5efc89d514
commit be61cf6a88
19 changed files with 107 additions and 110 deletions

View File

@@ -37,16 +37,12 @@ module.exports = function(RED) {
node.emit("input",{});
}, this.repeat );
} else if (this.crontab) {
if (cron) {
if (RED.settings.verbose) { this.log("crontab = "+this.crontab); }
this.cronjob = new cron.CronJob(this.crontab,
function() {
node.emit("input",{});
},
null,true);
} else {
this.error("'cron' module not found");
}
if (RED.settings.verbose) { this.log("crontab = "+this.crontab); }
this.cronjob = new cron.CronJob(this.crontab,
function() {
node.emit("input",{});
},
null,true);
}
if (this.once) {

View File

@@ -59,7 +59,7 @@ module.exports = function(RED) {
node.send([null,null,msg]);
});
ex.on('error', function (code) {
node.error(code);
node.error(code,msg);
});
}
else { node.error("Spawn command must be just the command - no spaces or extra parameters"); }

View File

@@ -90,7 +90,7 @@ module.exports = function(RED) {
errorMessage += " (line "+line+", col "+cha+")";
}
}
this.error(errorMessage);
this.error(errorMessage, msg);
}
});
} catch(err) {