1use thiserror::Error;
2
3#[derive(Error, Debug)]
4pub enum RstaskError {
5 #[error("IO error: {0}")]
6 Io(#[from] std::io::Error),
7
8 #[error("YAML serialization error: {0}")]
9 Yaml(#[from] serde_yaml::Error),
10
11 #[error("Git error: {0}")]
12 Git(#[from] git2::Error),
13
14 #[error("UUID error: {0}")]
15 Uuid(#[from] uuid::Error),
16
17 #[error("Bincode error: {0}")]
18 Bincode(#[from] bincode::Error),
19
20 #[error("JSON error: {0}")]
21 Json(#[from] serde_json::Error),
22
23 #[error("Invalid UUID: {0}")]
24 InvalidUuid(String),
25
26 #[error("Invalid status: {0}")]
27 InvalidStatus(String),
28
29 #[error("Invalid priority: {0}")]
30 InvalidPriority(String),
31
32 #[error("Invalid status transition from {0} to {1}")]
33 InvalidStatusTransition(String, String),
34
35 #[error("Task not found: {0}")]
36 TaskNotFound(String),
37
38 #[error("Repository not found: {0}")]
39 RepoNotFound(String),
40
41 #[error("Parse error: {0}")]
42 Parse(String),
43
44 #[error("{0}")]
45 Other(String),
46}
47
48pub type Result<T> = std::result::Result<T, RstaskError>;