#[non_exhaustive]pub enum RunProcessError {
#[non_exhaustive] CancelledRun {
invocation: Invocation,
},
#[non_exhaustive] UnrunnableCommand {
source: RunCommandError,
},
#[non_exhaustive] UnreportableOutput {
invocation: Invocation,
source: SendError,
},
}Expand description
The error returned when a command cannot run an external program
The variants separate what a caller does about the failure. A command that was cancelled stops, a command whose program never ran reports the program, and a command whose output can no longer be reported has lost its presenter and ends.
A program that ran and ended without success is no failure of the run. The
Execution then carries the status, and require_success turns
a status that the caller cannot accept into an error of its own.
A later release can add variants, and it can add fields to a variant. Match
with a wildcard arm, and bind the fields of a variant with ...
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
#[non_exhaustive]CancelledRun
Cancellation stopped the program before it ended
Clawless killed the program, so the run has no exit status and no complete output. A command that treats cancellation as an orderly end matches this variant and returns without an error.
Fields
This variant is marked as non-exhaustive
invocation: InvocationThe command that was cancelled
#[non_exhaustive]UnrunnableCommand
The program could not be run
No program answers to the name, the working directory does not exist, the operating system refused to start the program, or the run started and its result could not be collected. The message is the one of the underlying failure, because this layer knows nothing that the run does not already state.
Fields
This variant is marked as non-exhaustive
source: RunCommandErrorThe cause of the failure
#[non_exhaustive]UnreportableOutput
The output of the program could not be reported
The presenter stopped listening while the program ran, so the run has no consumer left. The program itself was killed with the run.
Fields
This variant is marked as non-exhaustive
invocation: InvocationThe command whose output could not be reported
Trait Implementations§
Source§impl Debug for RunProcessError
impl Debug for RunProcessError
Source§impl Display for RunProcessError
impl Display for RunProcessError
Source§impl Error for RunProcessError
impl Error for RunProcessError
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()