git_bump/
error.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
pub type Result<T> = std::result::Result<T, Error>;

#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum Error {
    #[error("Not a Git repository")]
    NotARepository,
    #[error("Not supported on bare repositories")]
    BareRepositoryNotSupported,
    #[error("Failed to load Lua code: {source}")]
    LuaLoadingFailed { source: mlua::Error },
    #[error("Failed to execute Lua code: {source}")]
    LuaExecutionFailed { source: mlua::Error },
    #[error("Failed to execute pre function: {source}")]
    LuaPreFuncFailed { source: mlua::Error },
    #[error("Failed to execute post function: {source}")]
    LuaPostFuncFailed { source: mlua::Error },
    #[error(transparent)]
    LuaError(#[from] mlua::Error),
    #[error("Failed to read to file: {source}")]
    ReadFailed { source: std::io::Error },
    #[error("Failed to write to file: {source}")]
    WriteFailed { source: std::io::Error },
    #[error(transparent)]
    IoError(#[from] std::io::Error),
}