#[non_exhaustive]pub enum RunError {
NotFound(String),
NotAllowed(String),
Injects {
task: String,
args: Vec<String>,
},
MissingArg(MissingArg),
InvalidArgName {
task: String,
args: Vec<String>,
},
Dependency(DepError),
Cancelled,
Io {
task: String,
program: String,
cwd: PathBuf,
source: Error,
},
}Expand description
Why a run* call could not complete. It reports the failure to resolve or
dispatch a job; a job that runs to a non-zero exit is not an error here (the
exit status rides back in the Ok). Only Debug is derived, because Io
wraps a std::io::Error, which is neither Clone nor PartialEq.
Non-exhaustive on purpose. This release adds a variant, which is a breaking
change only because it was not marked before; marking it now means the next
error mdtask learns to report costs consumers a _ arm they already have
rather than a major bump.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NotFound(String)
No job by that name across the resolved files (from run/run_captured).
NotAllowed(String)
The nearest definition of the named job is not Agent: allow, so an agent
surface may not run it (from run_agent only). A nearer non-allowed
definition shadowing a farther allowed one lands here too: fail closed.
Injects
The agent target raw-templates a declared arg into its script via
{{ arg }} (from run_agent only). args lists the offending names.
The job must read the value from the environment instead before an agent
may run it.
MissingArg(MissingArg)
A required positional argument had no value.
InvalidArgName
A job declares an argument whose name cannot be a shell variable, so the
script could never read it. args lists the offending names.
Refused rather than run, because running it reaches the script and fails
there as unbound variable naming the correct spelling used in the
script, which points away from the declaration that is wrong.
Dependency(DepError)
The Requires: chain could not be resolved (a typo or a cycle).
Cancelled
The run was stopped through a Cancel handle.
Distinct from a failing step: nothing went wrong, someone asked for it to stop. A caller that treats every non-success as an error would otherwise report a cancellation as a task failure.
Io
Spawning a step failed: the interpreter is not installed, or the directory the task would run in is gone.
Carries which task and which program, because the bare io::Error was
“No such file or directory (os error 2)” and nothing else. In a
Requires: chain that named neither the failing step nor the thing that
was missing, and the obvious reading of it, that a file the script
wanted was absent, was the wrong one.
Trait Implementations§
Source§impl Error for RunError
impl Error for RunError
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()