Skip to main content

serenade_notifier/
error.rs

1//! Notifier errors.
2
3/// Failure while building or sending a notification.
4#[derive(Debug, thiserror::Error, Clone, PartialEq, Eq)]
5pub enum NotifierError {
6    /// Recipient is empty.
7    #[error("notification has no recipient")]
8    MissingRecipient,
9    /// Message body is empty.
10    #[error("notification has no body")]
11    MissingBody,
12    /// Transport does not support this channel.
13    #[error("channel {channel} is not supported by this transport")]
14    UnsupportedChannel {
15        /// Channel name.
16        channel: String,
17    },
18    /// Transport backend failed.
19    #[error("notifier transport: {message}")]
20    Transport {
21        /// Reason text.
22        message: String,
23    },
24}