Skip to main content

flow_core/
error.rs

1use thiserror::Error;
2
3#[derive(Error, Debug)]
4pub enum FlowError {
5    #[error("IO error: {0}")]
6    Io(#[from] std::io::Error),
7
8    #[error("Config parse error: {0}")]
9    ConfigParse(#[from] toml::de::Error),
10
11    #[error("Git error: {0}")]
12    Git(String),
13
14    #[error("Tmux error: {0}")]
15    Tmux(String),
16
17    #[error("Project not found: {0}")]
18    ProjectNotFound(String),
19
20    #[error("Database error: {0}")]
21    Database(String),
22
23    #[error("Not found: {0}")]
24    NotFound(String),
25
26    #[error("Bad request: {0}")]
27    BadRequest(String),
28
29    #[error("Conflict: {0}")]
30    Conflict(String),
31
32    #[error("Parse error: {0}")]
33    Parse(String),
34
35    #[error("Timeout: {0}")]
36    Timeout(String),
37
38    #[error("Cycle detected: {0}")]
39    CycleDetected(String),
40
41    #[error("JSON error: {0}")]
42    Json(#[from] serde_json::Error),
43
44    #[error("Server error: {0}")]
45    Server(String),
46}