mirror of
https://codeberg.org/icewind/tasmota-mqtt-client.git
synced 2026-06-03 18:24:09 +02:00
make errors non_exhaustive
This commit is contained in:
parent
d86e09666f
commit
e724109154
1 changed files with 3 additions and 2 deletions
|
|
@ -5,11 +5,10 @@ use thiserror::Error;
|
||||||
pub type Result<T, E = Error> = std::result::Result<T, E>;
|
pub type Result<T, E = Error> = std::result::Result<T, E>;
|
||||||
|
|
||||||
#[derive(Debug, Error)]
|
#[derive(Debug, Error)]
|
||||||
|
#[non_exhaustive]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
#[error("Error with mqtt transport: {0:#}")]
|
#[error("Error with mqtt transport: {0:#}")]
|
||||||
Mqtt(MqttError),
|
Mqtt(MqttError),
|
||||||
#[error("Topic {0} doesn't follow expected format")]
|
|
||||||
MalformedTopic(String),
|
|
||||||
#[error("Malformed json payload received: {0:#}")]
|
#[error("Malformed json payload received: {0:#}")]
|
||||||
JsonPayload(serde_json::Error),
|
JsonPayload(serde_json::Error),
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
|
|
@ -27,6 +26,7 @@ impl From<serde_json::Error> for Error {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Error)]
|
#[derive(Debug, Error)]
|
||||||
|
#[non_exhaustive]
|
||||||
pub enum MqttError {
|
pub enum MqttError {
|
||||||
#[error("transparent")]
|
#[error("transparent")]
|
||||||
Client(ClientError),
|
Client(ClientError),
|
||||||
|
|
@ -55,6 +55,7 @@ impl From<ConnectionError> for Error {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Error)]
|
#[derive(Debug, Error)]
|
||||||
|
#[non_exhaustive]
|
||||||
pub enum DownloadError {
|
pub enum DownloadError {
|
||||||
#[error("Aborted")]
|
#[error("Aborted")]
|
||||||
DownloadAborted,
|
DownloadAborted,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue