#[non_exhaustive]pub enum WorktreeError {
NotAGitRepo,
GitCommand {
op: String,
stderr: String,
},
PathExists(PathBuf),
BaseRefUnresolved {
attempted: String,
},
InvalidBranchName(String),
RootOutsideRepo(PathBuf),
Io(Error),
QuotaExceeded {
current: usize,
max: usize,
},
}Expand description
All errors that zeph-worktree can produce.
Every variant is designed so that the Display message is safe to show to the
user; raw git stderr is kept in WorktreeError::GitCommand’s stderr field
and must only be logged at DEBUG level — never forwarded to the user.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NotAGitRepo
The working directory is not inside a git repository.
GitCommand
A git sub-command exited with a non-zero status.
op names the operation (e.g. "fetch", "worktree add").
stderr is raw git output — log at DEBUG, never surface to the user.
Fields
PathExists(PathBuf)
The computed worktree path already exists on disk.
BaseRefUnresolved
The default branch could not be resolved.
Emitted when config.default_branch is empty and
git symbolic-ref refs/remotes/origin/HEAD fails.
InvalidBranchName(String)
The subagent_id value contains characters that are not allowed in a
git branch component.
RootOutsideRepo(PathBuf)
The canonicalised worktree root resolves to a path outside the repository.
Io(Error)
An I/O error propagated from the OS or std::fs.
QuotaExceeded
A create() call was refused because worktree.max_worktrees would be
reached or exceeded.
current is the number of git-registered secondary worktrees under root
at the time of the check (including worktrees owned by other, concurrently
running zeph sessions); max is the configured max_worktrees limit. This
is a soft, best-effort cap — see
WorktreeManager::create’s doc comment
for the TOCTOU caveat under concurrent sessions.
Trait Implementations§
Source§impl Debug for WorktreeError
impl Debug for WorktreeError
Source§impl Display for WorktreeError
impl Display for WorktreeError
Source§impl Error for WorktreeError
impl Error for WorktreeError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()