pub enum Error {
AlreadyExists {
path: PathBuf,
},
NotAGitRepo {
path: PathBuf,
},
InvalidRunId {
run_id: String,
},
PathTooLong {
path: PathBuf,
length: usize,
limit: usize,
},
Io {
source: Error,
},
GitTimeout {
args: Vec<String>,
elapsed: Duration,
},
GitCommandFailed {
args: Vec<String>,
stderr: String,
},
}Variants§
AlreadyExists
The target worktree directory already exists on disk, or git worktree add reported an existing path. Raised both from the
pre-spawn exists() check and from the stderr classifier so a
TOCTOU race between the two calls still surfaces as
AlreadyExists rather than a generic GitCommandFailed.
NotAGitRepo
The volume root is not inside a git repository (or cannot reach
.git). Plan-mandated preflight for omne run.
InvalidRunId
run_id contains characters that would let the worktree path
escape .omne/wt/ (path separators, .., null, leading -).
Raised before any filesystem or git call so no partial state
leaks on rejection.
PathTooLong
Volume path is at or above PATH_LENGTH_ERROR characters.
Windows-only concern in practice, but the threshold is
platform-agnostic so tests behave the same on every host.
Note: this threshold measures the volume root only. Pipelines
that write deeply-nested files inside the worktree can still
blow past MAX_PATH even when the volume root passes preflight.
The threshold exists to catch the most common failure mode (long
user-profile paths), not to guarantee every downstream file
operation stays under 260.
Io
git could not be launched (missing binary, permission denied,
etc). Distinct from GitCommandFailed (which is git itself
returning non-zero).
GitTimeout
git ran past GIT_TIMEOUT without exiting. The child is
killed before this error is returned so no zombie subprocess
leaks.
GitCommandFailed
git ran but exited non-zero. stderr is preserved verbatim for
the command handler to surface.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl !UnwindSafe for Error
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more