pub enum HookError {
Failed {
hook_name: String,
status: i32,
output: HookOutput,
},
Spawn {
hook_name: String,
path: PathBuf,
source: Error,
output: HookOutput,
},
Internal(String),
Cancelled,
}Expand description
Hook subprocess failure (non-zero exit or spawn error).
Variants§
Failed
A hook ran and returned a non-zero exit status.
The message is one line; the hook’s own output is in output, never in Display.
Fields
output: HookOutputWhat the hooks wrote; empty under HookStdio::Inherit.
Spawn
The hook (or the shell that runs it) could not be started.
Fields
source: ErrorError returned by the CommandRunner when spawning.
output: HookOutputWhat earlier hooks for the same event wrote before this one could not start
(configured hook.<name>.* entries run before the hooks directory script); empty
under HookStdio::Inherit.
Internal(String)
Configuration or internal error while resolving hooks.
Cancelled
The hook subprocess was stopped because the operation was cancelled.
Implementations§
Source§impl HookError
impl HookError
Sourcepub fn output(&self) -> Option<&HookOutput>
pub fn output(&self) -> Option<&HookOutput>
Hook output captured before the failure, or None for HookError::Internal.
Trait Implementations§
Source§impl Error for HookError
impl Error for HookError
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()