jj_hooks/error.rs
1use thiserror::Error;
2
3#[derive(Debug, Error)]
4pub enum JjHooksError {
5 #[error("jj exited with status {status}: {stderr}")]
6 JjFailed { status: i32, stderr: String },
7
8 #[error("setup step `{name}` exited with status {status}")]
9 SetupFailed { name: String, status: i32 },
10
11 #[error("could not parse `jj git push --dry-run` output: {0}")]
12 Parse(String),
13
14 #[error(transparent)]
15 Io(#[from] std::io::Error),
16}
17
18pub type Result<T> = std::result::Result<T, JjHooksError>;