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

@@ -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() {