1use std::io;
2use thiserror::Error;
3
4#[derive(Error, Debug)]
6pub enum ImageError {
7 #[error("Failed to access image file: {0}")]
8 IoError(#[from] io::Error),
9
10 #[error("Failed to decode or process image: {0}")]
11 ImageError(#[from] image::ImageError),
12
13 #[error("Invalid image path: {0}")]
14 InvalidPath(String),
15
16 #[error("Cache error: {0}")]
17 CacheError(#[from] ferrite_cache::CacheError),
18
19 #[error("{0}")]
20 Other(String),
21}
22
23pub type Result<T> = std::result::Result<T, ImageError>;