1use thiserror::Error;
3
4pub type Result<T> = std::result::Result<T, TeamError>;
6
7#[derive(Debug, Error)]
9pub enum TeamError {
10 #[error("Team not found: {0}")]
11 TeamNotFound(String),
12
13 #[error("Member not found: {0}")]
14 MemberNotFound(String),
15
16 #[error("Permission denied: {0}")]
17 PermissionDenied(String),
18
19 #[error("Rule validation failed: {0}")]
20 RuleValidationFailed(String),
21
22 #[error("Configuration error: {0}")]
23 ConfigError(String),
24
25 #[error("Storage error: {0}")]
26 StorageError(String),
27
28 #[error("Learning error: {0}")]
29 LearningError(String),
30
31 #[error("Permissions error: {0}")]
32 PermissionsError(String),
33
34 #[error("Serialization error: {0}")]
35 SerializationError(#[from] serde_json::Error),
36
37 #[error("YAML error: {0}")]
38 YamlError(#[from] serde_yaml::Error),
39
40 #[error("IO error: {0}")]
41 IoError(#[from] std::io::Error),
42
43 #[error("Invalid role: {0}")]
44 InvalidRole(String),
45
46 #[error("Invalid scope: {0}")]
47 InvalidScope(String),
48
49 #[error("Concurrent modification detected")]
50 ConcurrentModification,
51
52 #[error("Operation timeout")]
53 Timeout,
54
55 #[error("Internal error: {0}")]
56 Internal(String),
57}