alert-me/app/src/error.rs

20 lines
546 B
Rust
Raw Normal View History

2024-05-11 16:37:41 +00:00
use sea_orm::DbErr;
use thiserror::Error;
#[derive(Error, Debug)]
#[error("opds error")]
pub enum Error {
2024-05-11 16:51:55 +00:00
/// Database Error
2024-05-11 16:37:41 +00:00
#[error("opds error")]
DbError(#[from] DbErr),
2024-05-11 16:51:55 +00:00
/// Error fetching data from alertswiss
2024-05-11 16:37:41 +00:00
#[error("data error")]
FetchError(#[from] reqwest::Error),
2024-05-11 19:27:22 +00:00
/// Error publishing to MQTT
#[error("mqtt client error")]
MqttCLientError(#[from] rumqttc::ClientError),
/// Error publishing to MQTT
#[error("mqtt connection error")]
MqttConnectionError(#[from] rumqttc::ConnectionError),
2024-05-11 16:37:41 +00:00
}