libbrat_worktree/
error.rs1use thiserror::Error;
4
5#[derive(Debug, Error)]
7pub enum WorktreeError {
8 #[error("git command failed: {0}")]
10 GitFailed(String),
11
12 #[error("worktree not found: {0}")]
14 NotFound(String),
15
16 #[error("worktree already exists: {0}")]
18 AlreadyExists(String),
19
20 #[error("max worktrees reached: {current}/{max}")]
22 MaxReached {
23 current: u32,
25 max: u32,
27 },
28
29 #[error("invalid worktree path: {0}")]
31 InvalidPath(String),
32
33 #[error("invalid session id: {0}")]
35 InvalidSessionId(String),
36
37 #[error("io error: {0}")]
39 Io(#[from] std::io::Error),
40}