use std::error::Error as StdError;
#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum MqttError {
#[error("mqtt connection error: {0}")]
Connect(#[source] Box<dyn StdError + Send + Sync>),
#[error("mqtt subscribe error on '{filter}': {reason}")]
Subscribe {
filter: String,
reason: String,
},
#[error("mqtt receive error: {0}")]
Receive(String),
#[error("mqtt publish error to '{topic}': {reason}")]
Publish {
topic: String,
reason: String,
},
#[error("mqtt broker is not connected")]
NotConnected,
#[error("invalid mqtt descriptor: {0}")]
Invalid(String),
}