ckb_app_config/
exit_code.rsuse std::io;
#[repr(i32)]
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub enum ExitCode {
Cli = 64,
Config = 65,
IO = 66,
Failure = 113,
}
impl ExitCode {
pub fn into(self) -> i32 {
self as i32
}
}
impl From<io::Error> for ExitCode {
fn from(err: io::Error) -> ExitCode {
eprintln!("IO Error: {err:?}");
ExitCode::IO
}
}
impl From<toml::de::Error> for ExitCode {
fn from(err: toml::de::Error) -> ExitCode {
eprintln!("Config Error: {err:?}");
ExitCode::Config
}
}
impl From<ckb_logger::SetLoggerError> for ExitCode {
fn from(err: ckb_logger::SetLoggerError) -> ExitCode {
eprintln!("Config Error: {err:?}");
ExitCode::Config
}
}