1use crate::SessionId;
4use thiserror::Error;
5
6#[derive(Error, Debug, Clone)]
8pub enum DomainError {
9 #[error("Session not found: {session_id}")]
11 SessionNotFound { session_id: SessionId },
12
13 #[error("Session already exists: {session_id}")]
15 SessionAlreadyExists { session_id: SessionId },
16
17 #[error("Invalid {field}: {value} (expected {expected})")]
19 InvalidFieldValue {
20 field: String,
21 value: String,
22 expected: String,
23 },
24
25 #[error("Failed to parse {field}: {reason}")]
27 ParseError { field: String, reason: String },
28}
29
30pub type DomainResult<T> = Result<T, DomainError>;