pub enum Error {
CommandFailed {
cmd: String,
status: i32,
stderr: String,
io: Option<Error>,
},
MissingDependency {
binary: String,
detail: String,
hint: Option<String>,
io: Option<Error>,
},
Config(ConfigError),
NoMatch {
pattern: String,
},
ConfirmationMismatch {
expected: String,
actual: String,
},
Cancelled,
InvalidArgument(String),
Io(Error),
Serde(String),
}Expand description
Library error type. Every variant carries enough context that a user-facing message can be derived without re-running the failing command.
Variants§
CommandFailed
A subprocess exited non-zero. stderr is preserved verbatim
so the caller can show the underlying tool’s diagnosis.
MissingDependency
The target binary is not on PATH. hint is a copy-pastable
fix instruction.
Config(ConfigError)
Config file could not be read or written.
NoMatch
The parsed diskutil output did not contain an NTFS volume
matching the user’s request.
ConfirmationMismatch
Confirmation phrase did not match.
Cancelled
User pressed Ctrl-C or answered “no” to a confirmation prompt.
InvalidArgument(String)
Argument validation failure (empty label, unknown device, …).
Io(Error)
Underlying I/O error that does not fit into a more specific
variant. Kept narrow so ? from std::fs::read_to_string and
the like still works.
Serde(String)
Serialization / parsing error (plist, toml, json).
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()