ricecoder_sessions/
error.rs1use std::io;
4use thiserror::Error;
5
6pub type SessionResult<T> = Result<T, SessionError>;
8
9#[derive(Debug, Error)]
11pub enum SessionError {
12 #[error("Session not found: {0}")]
14 NotFound(String),
15
16 #[error("Session already exists: {0}")]
18 AlreadyExists(String),
19
20 #[error("Invalid session: {0}")]
22 Invalid(String),
23
24 #[error("Session limit reached: maximum {max} sessions allowed")]
26 LimitReached { max: usize },
27
28 #[error("Storage error: {0}")]
30 StorageError(String),
31
32 #[error("IO error: {0}")]
34 IoError(#[from] io::Error),
35
36 #[error("JSON error: {0}")]
38 JsonError(#[from] serde_json::Error),
39
40 #[error("Configuration error: {0}")]
42 ConfigError(String),
43
44 #[error("Share not found: {0}")]
46 ShareNotFound(String),
47
48 #[error("Share expired: {0}")]
50 ShareExpired(String),
51
52 #[error("Permission denied: {0}")]
54 PermissionDenied(String),
55
56 #[error("Background agent error: {0}")]
58 AgentError(String),
59}