1use std::path::PathBuf;
2use thiserror::Error;
3
4use crate::environment::EnvironmentRef;
5
6#[derive(Debug, Error)]
9pub enum Error {
10 #[error("catalog.xml cannot be found")]
13 NoCatalogFound,
14 #[error("File not found in catalog: {0}")]
15 FileNotFoundInCatalog(PathBuf),
16 #[error("Unknown environment reference")]
17 UnknownEnvironmentReference(EnvironmentRef),
18 #[error("Cannot represent as XML")]
19 CannotRepresentAsXml,
20 #[error("Xee XPath error")]
21 XeeXPath(#[from] xee_xpath::error::ErrorValue),
22 #[error("Xot error")]
23 Xot(#[from] xot::Error),
24 #[error("IO error")]
25 IO(#[from] std::io::Error),
26 #[error("Var error")]
27 Var(#[from] std::env::VarError),
28 #[error("Globset error")]
29 GlobSet(#[from] globset::Error),
30}
31
32pub type Result<T> = std::result::Result<T, Error>;