use std::path::PathBuf;
#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum Error {
#[error("the built-in catalog contains an invalid pattern `{pattern}`")]
CatalogPattern {
pattern: String,
#[source]
source: globset::Error,
},
#[error("watch mode failed: {reason}")]
Watch {
reason: String,
},
#[error("in `{}`: {reason}", path.display())]
Config {
path: PathBuf,
reason: String,
},
#[error("`{name}` is not a known ecosystem or artifact — run `voom catalog` to see the table")]
UnknownEcosystem {
name: String,
},
#[error("`{input}` is not a duration: {reason}")]
InvalidDuration {
input: String,
reason: &'static str,
},
#[error("`{input}` is not a size: {reason}")]
InvalidSize {
input: String,
reason: &'static str,
},
#[error("building a worker pool of {jobs} threads")]
ThreadPool {
jobs: usize,
#[source]
source: rayon::ThreadPoolBuildError,
},
#[error("reading directory `{}`", path.display())]
ReadDir {
path: PathBuf,
#[source]
source: std::io::Error,
},
}
pub type Result<T, E = Error> = std::result::Result<T, E>;