pub enum HookError {
Failed {
hook_name: String,
status: i32,
output: HookOutput,
},
Spawn {
hook_name: String,
path: PathBuf,
source: Error,
output: HookOutput,
},
Internal(String),
}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.
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)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl !RefUnwindSafe for HookError
impl !UnwindSafe for HookError
impl Freeze for HookError
impl Send for HookError
impl Sync for HookError
impl Unpin for HookError
impl UnsafeUnpin for HookError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more