use thiserror::Error;
#[derive(Debug, Error)]
pub enum SessionStoreError {
#[error("session record not found: {0}")]
NotFound(String),
#[error("session record already exists: {0}")]
AlreadyExists(String),
#[error("session record conflict: {0}")]
Conflict(String),
#[error("session stale fence: {0}")]
StaleFence(String),
#[error("session idempotency conflict: {0}")]
IdempotencyConflict(String),
#[error("session quota exceeded: {0}")]
QuotaExceeded(String),
#[error("session run conflict: {0}")]
RunConflict(String),
#[error("session store temporarily unavailable: {0}")]
RetryableStorage(String),
#[error("session store failed: {0}")]
Failed(String),
}
pub type SessionStoreResult<T> = Result<T, SessionStoreError>;
impl From<SessionStoreError> for starweaver_context::AgentExecutorError {
fn from(error: SessionStoreError) -> Self {
Self::Failed(error.to_string())
}
}