freedesktop_icon_lookup/
err.rs

1use std::io::Error as IoError;
2use std::path::PathBuf;
3
4use thiserror::Error;
5
6#[derive(Error, Debug)]
7pub enum Error {
8    #[error("icon theme index is missing: {path:?}")]
9    ThemeIndexMissing { path: PathBuf, source: IoError },
10    #[error("icon theme index is invalid: {path:?}")]
11    InvalidIndex { path: PathBuf, source: tini::Error },
12    #[error("invalid theme{}", reason.as_ref().map(|r| format!(": {r}")).unwrap_or_default())]
13    InvalidTheme { reason: Option<String> },
14    #[error("theme not found")]
15    ThemeNotFound,
16    #[error("error at icon dir traversing")]
17    TraverseDir { source: IoError },
18    #[error("inheritance cycle detected")]
19    CycleDetected,
20}
21
22pub type Result<T, E = Error> = core::result::Result<T, E>;