1use crate::NotifierItemMessage;
2use thiserror::Error;
3use tokio::sync::broadcast;
4
5pub type Result<T> = std::result::Result<T, StatusNotifierWatcherError>;
6
7#[derive(Error, Debug)]
8pub enum StatusNotifierWatcherError {
9 #[error("Dbus connection error")]
10 DbusError(#[from] zbus::Error),
11 #[error("Invalid DBus interface name")]
12 InterfaceNameError(#[from] zbus::names::Error),
13 #[error("Failed to call DBus standard interface method")]
14 DBusStandardInterfaceError(#[from] zbus::fdo::Error),
15 #[error("Serialization error")]
16 ZvariantError(#[from] zbus::zvariant::Error),
17 #[error("Service path {0} was not understood")]
18 DbusAddressError(String),
19 #[error("Failed to broadcast message to notifier hosts")]
20 BroadCastSendError(#[from] broadcast::error::SendError<NotifierItemMessage>),
21 #[error("Error receiving broadcast message")]
22 BroadCastRecvError(#[from] broadcast::error::RecvError),
23}