#[non_exhaustive]pub enum Error {
Spawn {
program: String,
source: Error,
},
Exit {
program: String,
code: i32,
stderr: String,
},
Timeout {
program: String,
timeout: Duration,
},
Parse {
program: String,
message: String,
},
Io(Error),
}Expand description
Errors produced when launching or running a child process.
Mirrors the .NET ProcessExitException (the Exit variant)
while folding spawn/timeout/IO failures into one structured enum, so callers
can pattern-match on the failure mode instead of parsing strings.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Spawn
The child process could not be started (binary not found, permission denied, …).
Exit
The process ran to completion but exited with a non-zero status.
Produced by the ensure_success helpers; the raw exit code is otherwise
reported without erroring (a non-zero exit is not inherently a failure).
Fields
Timeout
The process exceeded its configured timeout and was killed.
Parse
The process succeeded but its output could not be parsed into the
expected shape (e.g. malformed --json). Produced by the fallible-parse
helpers on CliClient.
Io(Error)
An IO error occurred while driving the process (reading a pipe, writing stdin, waiting for exit).
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()