Skip to main content

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//!
8//! Copyright (c) systemprompt.io — Business Source License 1.1.
9//! See <https://systemprompt.io> for licensing details.
10
11use thiserror::Error;
12
13#[derive(Debug, Error)]
14pub enum EventError {
15    #[error("event serialization failed: {0}")]
16    Serialization(#[from] serde_json::Error),
17
18    #[error("event channel saturated for {target}")]
19    ChannelFull { target: String },
20}
21
22pub type EventResult<T> = Result<T, EventError>;