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:
@@ -68,7 +68,8 @@ module.exports = function(RED) {
|
||||
}
|
||||
node.port.write(payload,function(err,res) {
|
||||
if (err) {
|
||||
node.error(err);
|
||||
var errmsg = err.toString().replace("Serialport","Serialport "+node.port.serial.path);
|
||||
node.error(errmsg,msg);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@@ -470,13 +470,13 @@ module.exports = function(RED) {
|
||||
});
|
||||
|
||||
client.on('error', function() {
|
||||
node.log('connect failed');
|
||||
node.error('connect failed',msg);
|
||||
node.status({fill:"red",shape:"ring",text:"error"});
|
||||
if (client) { client.end(); }
|
||||
});
|
||||
|
||||
client.on('timeout',function() {
|
||||
node.log('connect timeout');
|
||||
node.warn('connect timeout');
|
||||
if (client) {
|
||||
client.end();
|
||||
setTimeout(function() {
|
||||
|
@@ -154,7 +154,7 @@ module.exports = function(RED) {
|
||||
}
|
||||
sock.send(message, 0, message.length, por, add, function(err, bytes) {
|
||||
if (err) {
|
||||
node.error("udp : "+err);
|
||||
node.error("udp : "+err,msg);
|
||||
}
|
||||
message = null;
|
||||
});
|
||||
|
Reference in New Issue
Block a user