mirror of
https://github.com/parnic/MMM-IntelliCenter.git
synced 2025-06-16 05:10:14 -05:00
Catch errors on initial connection
This commit is contained in:
@ -389,7 +389,18 @@ module.exports = NodeHelper.create({
|
||||
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) {
|
||||
|
Reference in New Issue
Block a user