Skip to content

Commit

Permalink
Merge pull request #65 from Jalle19/stacktrace
Browse files Browse the repository at this point in the history
Log the stack trace when catching unknown exceptions
  • Loading branch information
Jalle19 authored May 22, 2023
2 parents 7c25f28 + 6121661 commit e0fa962
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## future release

* Log stack traces for unknown errors (should help debug https://github.com/Jalle19/home-assistant-addon-repository/issues/17)
* Use `%` instead of `%H` for MQTT humidity sensor entities (https://github.com/Jalle19/eda-modbus-bridge/issues/64)
* Fix automatic reconnect to MQTT broker when initial connection attempt fails (https://github.com/Jalle19/eda-modbus-bridge/issues/61)

Expand Down
4 changes: 3 additions & 1 deletion eda-modbus-bridge.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ const argv = yargs(process.argv.slice(2))
mqttClient.on('reconnect', () => {
console.log(`Attempting to reconnect to ${argv.mqttBrokerUrl}`)
})
} catch (e) {}
} catch (e) {
console.error(`Unknown exception occurred: ${e.message}`, e.stack)
}
}
})()

0 comments on commit e0fa962

Please sign in to comment.