pub enum CliError {
NotAVolume,
VolumeAlreadyExists {
path: PathBuf,
},
ValidationFailed {
issues: Vec<String>,
},
Distro(Error),
Manifest(Error),
Github(Error),
Tarball(Error),
TarballLayoutMismatch {
expected: String,
found: Vec<String>,
},
Python(Error),
UnsafeTarget {
path: PathBuf,
},
SymlinkPrivilegeRequired,
Io(String),
}Expand description
Error variant categories map to process exit codes at main.rs:
logical errors (cross-cutting variants and module-wrapper variants)
exit with code 1; clap argument-parse errors exit with code 2 via
clap’s own machinery. Successful runs exit with code 0.
The variants below are reserved for the command handlers that land in
Units 8a, 9, and 10. The earlier units only wire up the dispatcher,
stub handlers, and leaf modules, so none of the variants are
constructed yet — the #[allow(dead_code)] is scoped to the enum and
will be removed automatically as each variant picks up a first call
site.
Variants§
NotAVolume
Walk-up from the current directory did not find a .omne/ root.
Produced by upgrade and validate when invoked outside a volume.
VolumeAlreadyExists
Produced by init when the current directory already contains a
.omne/ directory. The precheck deliberately does not walk up,
per R13: init creates in the current directory only.
ValidationFailed
Produced by validate after collecting one or more issues.
The issue strings are carried in the variant so callers and
tests can introspect them structurally; main.rs prints the
header and each issue line.
Distro(Error)
Wraps distro::Error (e.g. UnsupportedSpec for file:// or
non-github.com hosts). Produced by init at argument parse time.
Manifest(Error)
Wraps manifest::Error (missing frontmatter, missing required
field, YAML parse failure). Produced by upgrade and validate
when reading .omne/MANIFEST.md.
Github(Error)
Wraps github::Error (rate limit, auth failure, no release found,
no tarball asset, sanitized HTTP error). Produced by init and
upgrade when fetching releases.
Tarball(Error)
Wraps tarball::Error (path traversal, unsupported entry type,
pre-planted symlink, I/O). Produced during tarball extraction in
init and upgrade.
TarballLayoutMismatch
The extracted tarball did not contain the expected top-level
directory (e.g. core/ for kernel, image/ for distro).
Indicates the upstream release workflow changed its tarball layout.
Python(Error)
Wraps python::Error (gate runner failure, timeout, interpreter
invocation failure). Produced by validate when running the gate
runner script.
UnsafeTarget
The target directory for upgrade contains or is reached via a
symlink. Refusing to remove_dir_all to prevent symlink traversal.
SymlinkPrivilegeRequired
Windows-only: creating a directory symlink failed with ERROR_PRIVILEGE_NOT_HELD (1314). Tells the user the two ways to unlock symlink creation so they can re-run.
Io(String)
Wraps std::io::Error for filesystem and cwd operations.
Implementations§
Trait Implementations§
Source§impl Error for CliError
impl Error for CliError
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 CliError
impl !RefUnwindSafe for CliError
impl Send for CliError
impl Sync for CliError
impl Unpin for CliError
impl UnsafeUnpin for CliError
impl !UnwindSafe for CliError
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