mirror of
https://github.com/parnic/MMM-IntelliCenter.git
synced 2025-06-16 13:20:12 -05:00
Catch errors on initial connection
This commit is contained in:
@ -389,7 +389,18 @@ module.exports = NodeHelper.create({
|
|||||||
cb(poolData);
|
cb(poolData);
|
||||||
});
|
});
|
||||||
|
|
||||||
foundUnit.connect();
|
foundUnit.connect().catch((ex) => {
|
||||||
|
Log.error(
|
||||||
|
`[MMM-IntelliCenter] error attempting to connect to unit: ${ex}`,
|
||||||
|
);
|
||||||
|
Log.error(
|
||||||
|
`[MMM-IntelliCenter] restarting the connection process in ${reconnectDelayMs / 1000} seconds`,
|
||||||
|
);
|
||||||
|
|
||||||
|
unitReconnectTimer = setTimeout(() => {
|
||||||
|
this.connect(cb, reconnectCb);
|
||||||
|
}, reconnectDelayMs);
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
findServer(cb, reconnectCb) {
|
findServer(cb, reconnectCb) {
|
||||||
|
Reference in New Issue
Block a user