Improve MQTT error message
This commit is contained in:
1 file changed
+4
-4
+4
-4
@@ -264,12 +264,12 @@ impl Mqtt {
|
||||
impl Drop for Mqtt {
|
||||
fn drop(&mut self) {
|
||||
if let Some(drop_message) = self.drop_message.as_ref() {
|
||||
if self
|
||||
let res = self
|
||||
.get_sender()
|
||||
.try_send_message(&drop_message.topic, &drop_message.message, true)
|
||||
.is_err()
|
||||
.try_send_message(&drop_message.topic, &drop_message.message, true);
|
||||
if res.is_err()
|
||||
{
|
||||
error!("Failed to send offline message to mqtt");
|
||||
error!("Failed to send offline message to mqtt: {:?}. Is the MQTT topic name valid?", res.err().unwrap());
|
||||
}
|
||||
}
|
||||
self.set.abort_all();
|
||||
|
||||
Reference in new issue
Block a user