pub type Result = std::result::Result; #[derive(Debug, thiserror::Error)] pub enum Error { #[error("IO error: {0}")] IO(#[from] std::io::Error), #[error("Poison error: {0}")] Poison(String), #[error("Join error: {0}")] Join(#[from] tokio::task::JoinError), #[error("ZBus error: {0}")] ZBus(#[from] zbus::Error), #[error("ZBus fdo error: {0}")] Fdo(#[from] zbus::fdo::Error), #[error("ZBus zvariant error: {0}")] ZVariant(#[from] zbus::zvariant::Error), #[error("Json serde error: {0}")] Json(#[from] serde_json::Error), #[error("Send error: {0}")] Send(String), } impl From> for Error { fn from(err: tokio::sync::mpsc::error::SendError) -> Self { Self::Send(err.to_string()) } } impl From> for Error { fn from(err: std::sync::PoisonError) -> Self { Self::Poison(err.to_string()) } }