diff options
author | Adam T. Carpenter <atc@53hor.net> | 2020-10-31 10:44:31 -0400 |
---|---|---|
committer | Adam T. Carpenter <atc@53hor.net> | 2020-10-31 10:44:31 -0400 |
commit | 050e40c03900827057ab5db2f6bbe971a6408fda (patch) | |
tree | caa3a97208d077e2206f735f9ecd6618b4ac9ebf /dichroism/src/error.rs | |
parent | 3e1eadbbfdca1b2c0cb32ba4c8e1160a60e0ccb8 (diff) | |
download | theglassyladies-050e40c03900827057ab5db2f6bbe971a6408fda.tar.xz theglassyladies-050e40c03900827057ab5db2f6bbe971a6408fda.zip |
blocking on photo set generation since it hits the fs
Diffstat (limited to 'dichroism/src/error.rs')
-rw-r--r-- | dichroism/src/error.rs | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/dichroism/src/error.rs b/dichroism/src/error.rs index 62333d0..0cdd269 100644 --- a/dichroism/src/error.rs +++ b/dichroism/src/error.rs @@ -1,7 +1,7 @@ #[derive(Debug)] pub enum DichroismError { - UriDataExtract, - ImageWrite, + UriDataExtract(String), + ImageWrite(String), } impl std::error::Error for DichroismError {} @@ -11,3 +11,15 @@ impl std::fmt::Display for DichroismError { write!(f, "{}", self) } } + +impl From<image::ImageError> for DichroismError { + fn from(e: image::ImageError) -> Self { + Self::ImageWrite(e.to_string()) + } +} + +impl From<base64::DecodeError> for DichroismError { + fn from(e: base64::DecodeError) -> Self { + Self::UriDataExtract(e.to_string()) + } +} |