AtherEnergy / rumqtt

Pure rust mqtt cilent
The Unlicense
203 stars 72 forks source link

Clearer error on connection refused #147

Open bestouff opened 5 years ago

bestouff commented 5 years ago

When the connection to the broker fails, rumqtt logs:

ERROR 2019-04-29T13:16:50Z: rumqtt::client::connection: Connection error = Error(Inner(MqttConnectionRefused(5)))

In this case, I would have liked to see "not authorised" or something like that in the logs. Maybe it's the signification of the 5 I see, but would it be possible to make it clearer ?

bestouff commented 5 years ago

I see this now:

ERROR 2019-05-28T08:02:03Z: rumqtt::client::connection: Connection error = Error(Inner(Io(Custom { kind: Other, error: StringError("failed to lookup address information: Name or service not known") })))

... which is fine with me. Is it fixed in all cases ?

tekjar commented 5 years ago

In this case, I would have liked to see "not authorised"

I thinks this will be an improvement but we can easily check the mqtt return code spec for now