mqttjs / async-mqtt

Promise wrapper over MQTT.js
MIT License
271 stars 49 forks source link

TLS error not caught by error event #47

Open palatinb opened 2 years ago

palatinb commented 2 years ago

Hello,

I used your package in one of my app and I noticed that after a time I got ECONNRESET error, but it is not caught in the client.on('error',..) method. As I found out in the in the mqttjs package it is already implemented that, the following TLS errors are emit the error event:

Could you please also implement this in this package too?

Thanks,

mathis92 commented 2 years ago

Same issue for me, i am getting some random disconnections from the lib, it is trying to reconnect but it is pretty hard to find the reason of disconnection when there is no error emitted from the lib itself only close and reconnect events.

It would be grate to have this implemented directly to be able to consume also the error events.

thanks

palatinb commented 2 years ago

Can anybody help?

RangerMauve commented 2 years ago

asyncClient.on('error') should be invoking .on('error') on the underlying MQTT client, so I'm not sure why you aren't catching errors.

Could you post a minimal reproducible test case for this issue?