git_claw/workflow/
error.rs1use crate::core::error::{BranchError, ConfigError, PortError};
4use crate::infra::error::{GitError, HookError, LockError, RegistryError, WorktreeError};
5use thiserror::Error;
6
7#[derive(Error, Debug)]
8pub enum WorkflowError {
9 #[error("Slot name '{0}' is already active in this repository")]
10 DuplicateSlotName(String),
11
12 #[error("Worktree '{0}' not found in active slots registry")]
13 WorktreeNotFound(String),
14
15 #[error("Cannot infer active worktree from current directory '{0}'")]
16 CannotInferWorktree(String),
17
18 #[error("No git remote configured for this repository")]
19 NoRemoteConfigured,
20
21 #[error("Primary repository working tree has uncommitted modifications; cannot merge safely")]
22 DirtyWorkingTree,
23
24 #[error("Branch '{0}' already exists in this repository")]
25 BranchExists(String),
26
27 #[error("Command execution failed: {0}")]
28 CommandExecutionFailed(String),
29
30 #[error("No command specified to execute")]
31 NoCommandSpecified,
32
33 #[error("Invalid SemVer version '{0}': expected format like 'v1.2.0' or '1.2.0'")]
34 InvalidSemVer(String),
35
36 #[error(transparent)]
37 Config(#[from] ConfigError),
38
39 #[error(transparent)]
40 Port(#[from] PortError),
41
42 #[error(transparent)]
43 Branch(#[from] BranchError),
44
45 #[error(transparent)]
46 Git(#[from] GitError),
47
48 #[error(transparent)]
49 Lock(#[from] LockError),
50
51 #[error(transparent)]
52 Registry(#[from] RegistryError),
53
54 #[error(transparent)]
55 Worktree(#[from] WorktreeError),
56
57 #[error(transparent)]
58 Hook(#[from] HookError),
59
60 #[error("I/O error: {0}")]
61 Io(#[from] std::io::Error),
62}