use std::process::{ExitCode, Termination}; pub type Result = std::result::Result; #[derive(thiserror::Error, Debug)] #[repr(u8)] pub enum Error { #[error("IO error: {0}")] IO(#[from] std::io::Error), #[error("Config error: {0}")] Config(#[from] figment::error::Error), #[error("Paths error: {0}")] Paths(#[from] crate::paths::Error), #[error("Finder error: {0}")] Finder(#[from] crate::finder::Error), } impl Termination for Error { fn report(self) -> ExitCode { eprintln!("{}", self); ExitCode::FAILURE } }