picasso_core/
errors.rs

1use image::ImageError;
2
3#[derive(Clone, Debug)]
4pub enum PicassoError {
5    NoneError,
6    IOError(String),
7    ImageError(String),
8}
9
10pub type PicassoResult<T> = std::result::Result<T, PicassoError>;
11
12impl From<ImageError> for PicassoError {
13    fn from(e: ImageError) -> Self {
14        match e {
15            ImageError::IoError(e) => PicassoError::IOError(format!("{}", e)),
16            _ => PicassoError::ImageError(format!("{}", e)),
17        }
18    }
19}