1use std::sync::PoisonError;
2
3#[derive(thiserror::Error, Debug)]
5#[allow(missing_docs)]
6pub enum Error
7{
8 #[error("SendError in streams communication, most likely end of stream: {0}.")]
9 SendError(String),
10 #[error("IO Error: {0}.")]
11 IOError(#[from] std::io::Error),
12 #[error("Serialization error: {0}")]
13 JsonSerializationError(#[from] serde_json::Error),
14 #[error("Deserialization error: {0}")]
15 DeserializationError(String),
16 #[cfg(feature = "image")]
17 #[error("Image error: {0}")]
18 ImageError(#[from] image::ImageError),
19 #[error("Poison (Mutex/RwLock) error: {0}")]
20 PoisonError(String),
21}
22
23impl<T> From<PoisonError<T>> for Error
24{
25 fn from(value: PoisonError<T>) -> Self
26 {
27 Error::PoisonError(value.to_string())
28 }
29}