#[non_exhaustive]pub enum HookError {
Failed {
hook_name: String,
status: i32,
output: HookOutput,
},
Spawn {
hook_name: String,
path: PathBuf,
source: Error,
output: HookOutput,
},
MissingHookCommand {
hook_name: String,
},
}Expand description
Hook subprocess failure (non-zero exit or spawn error).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future 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.
MissingHookCommand
A configured hook event references hook.<name> without hook.<name>.command.
Implementations§
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 Forget 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