systemprompt_events/error.rs
1//! Error types raised by the event-broadcasting infrastructure.
2//!
3//! [`EventError`] is the public, `thiserror`-derived enum returned from every
4//! fallible operation in the crate. It composes via `#[from]` with
5//! `serde_json::Error` so callers can compose it into larger error enums
6//! without wrapping by hand.
7
8use thiserror::Error;
9
10#[derive(Debug, Error)]
11pub enum EventError {
12 #[error("event serialization failed: {0}")]
13 Serialization(#[from] serde_json::Error),
14
15 #[error("event channel saturated for {target}")]
16 ChannelFull { target: String },
17}
18
19pub type EventResult<T> = Result<T, EventError>;