diff --git a/main.js b/main.js index 33c6823..ee8faad 100644 --- a/main.js +++ b/main.js @@ -218,12 +218,10 @@ mqtt.on('disconnected', function() { mqtt.connect(); }); -mqtt.on('error', function() { - setTimeout(function (){ - mqtt.connect(); - }, 1000); +mqtt.on('error', function () { + setTimeout(function () { + throw new Error("Crashed") + }, 1000); }); - - mqtt.connect();