Skip to content

Commit

Permalink
feat(mqtt): display mqtt errors
Browse files Browse the repository at this point in the history
it doesnt automatically error on them but at least shows them to stdout
  • Loading branch information
EdJoPaTo committed Jan 18, 2024
1 parent a50d419 commit d6b199a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions source/home-telegram-bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ client.on('connect', async () => {
await client.publish('home-telegram-bot/connected', '2', {retain});
console.log('subscribed to topics', config.mqttTopics);
});
client.on('error', error => {
console.error('Error MQTT', error);
});

client.on('message', async (topic, payload, packet) => {
if (packet.cmd !== 'publish') {
Expand Down

0 comments on commit d6b199a

Please sign in to comment.