Skip to content

Commit

Permalink
fix crash in logging
Browse files Browse the repository at this point in the history
  • Loading branch information
DutchmanNL committed May 27, 2021
1 parent fe81f86 commit b7122b1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ class Esphome extends utils.Adapter {
let optimisedError = error.message;
// Optimise error messages
if (error.message.includes('EHOSTUNREACH')){
optimisedError = `Client ${this.deviceInfo[host].deviceInfo.name} not reachable !`;
optimisedError = `Client ${this.deviceInfo[host].ip} not reachable !`;
if (!warnMessages[host].connectError) {
this.log.error(optimisedError);
warnMessages[host].connectError = true;
Expand All @@ -448,7 +448,7 @@ class Esphome extends utils.Adapter {
optimisedError = `Client ${host} incorrect password !`;
this.log.error(optimisedError);
} else if (error.message.includes('ECONNRESET')){
optimisedError = `Client ${this.deviceInfo[host].deviceInfo.name} Connection Lost, will reconnect automatically when device is available!`;
optimisedError = `Client ${this.deviceInfo[host].ip} Connection Lost, will reconnect automatically when device is available!`;
this.log.warn(optimisedError);
} else if (error.message.includes('timeout')){
optimisedError = `Client ${host} Timeout, connection Lost, will reconnect automatically when device is available!`;
Expand Down

0 comments on commit b7122b1

Please sign in to comment.