make errors non_exhaustive

This commit is contained in:
Robin Appelman 2024-10-30 18:21:03 +01:00
commit e724109154

View file

@ -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,