starweaver_session/
error.rs1use thiserror::Error;
4
5#[derive(Debug, Error)]
7pub enum SessionStoreError {
8 #[error("session record not found: {0}")]
10 NotFound(String),
11 #[error("session record already exists: {0}")]
13 AlreadyExists(String),
14 #[error("session record conflict: {0}")]
16 Conflict(String),
17 #[error("session idempotency conflict: {0}")]
19 IdempotencyConflict(String),
20 #[error("session quota exceeded: {0}")]
22 QuotaExceeded(String),
23 #[error("session run conflict: {0}")]
25 RunConflict(String),
26 #[error("session store failed: {0}")]
28 Failed(String),
29}
30
31pub type SessionStoreResult<T> = Result<T, SessionStoreError>;
33
34impl From<SessionStoreError> for starweaver_context::AgentExecutorError {
35 fn from(error: SessionStoreError) -> Self {
36 Self::Failed(error.to_string())
37 }
38}