Skip to main content

starweaver_session/
error.rs

1//! Session store errors.
2
3use thiserror::Error;
4
5/// Session store failure.
6#[derive(Debug, Error)]
7pub enum SessionStoreError {
8    /// Record was not found.
9    #[error("session record not found: {0}")]
10    NotFound(String),
11    /// Record already exists.
12    #[error("session record already exists: {0}")]
13    AlreadyExists(String),
14    /// Store failed.
15    #[error("session store failed: {0}")]
16    Failed(String),
17}
18
19/// Result alias for session store operations.
20pub type SessionStoreResult<T> = Result<T, SessionStoreError>;
21
22impl From<SessionStoreError> for starweaver_runtime::AgentExecutorError {
23    fn from(error: SessionStoreError) -> Self {
24        Self::Failed(error.to_string())
25    }
26}