serenade-event 1.0.0

Sync event dispatcher and subscriber registration
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! Event dispatcher errors.

/// Failure while dispatching or handling an event.
#[derive(Debug, thiserror::Error, Clone, PartialEq, Eq)]
pub enum EventError {
    /// A subscriber returned a failure.
    #[error("subscriber `{subscriber}` failed on `{event}`: {message}")]
    Subscriber {
        /// Subscriber diagnostic name (event name plus priority).
        subscriber: String,
        /// Event name.
        event: &'static str,
        /// Underlying error text.
        message: String,
    },
}