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