Skip to main content

syncable_ag_ui_server/
error.rs

1//! Error types for AG-UI server operations.
2
3use syncable_ag_ui_core::AgUiError;
4use thiserror::Error;
5
6/// Errors that can occur in AG-UI server operations.
7#[derive(Debug, Error)]
8pub enum ServerError {
9    /// Core AG-UI error
10    #[error("Core error: {0}")]
11    Core(#[from] AgUiError),
12
13    /// Transport layer error (SSE, WebSocket, etc.)
14    #[error("Transport error: {0}")]
15    Transport(String),
16
17    /// Serialization error during event emission
18    #[error("Serialization error: {0}")]
19    Serialization(String),
20
21    /// Channel or stream error
22    #[error("Channel error: {0}")]
23    Channel(String),
24
25    /// Connection error
26    #[error("Connection error: {0}")]
27    Connection(String),
28}
29
30/// Result type alias using ServerError
31pub type Result<T> = std::result::Result<T, ServerError>;