mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Add node.error handling to core nodes
This commit is contained in:
@@ -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) {
|
||||
|
@@ -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"); }
|
||||
|
@@ -90,7 +90,7 @@ module.exports = function(RED) {
|
||||
errorMessage += " (line "+line+", col "+cha+")";
|
||||
}
|
||||
}
|
||||
this.error(errorMessage);
|
||||
this.error(errorMessage, msg);
|
||||
}
|
||||
});
|
||||
} catch(err) {
|
||||
|
Reference in New Issue
Block a user