use thiserror::Error;
#[derive(Error, Debug)]
pub enum Error {
#[error("activation of liveliness failed: reason {source:?}")]
ActivateLiveliness {
source: Box<dyn core::error::Error + Send + Sync>,
},
#[error("managing state failed")]
ManageState,
#[error("callback is missing")]
MissingCallback,
#[error("communicator is not implemented")]
NotImplemented,
#[error("get in {0} failed")]
Get(String),
#[error("get mutable in {0} failed")]
GetMut(String),
#[error("a Mutex poison error happened in {0}")]
MutexPoison(String),
#[error("accesssing the storage for read failed")]
ReadAccess,
#[error("accesssing the storage for write failed")]
WriteAccess,
#[error("read context for {0} failed")]
ReadContext(String),
#[error("write context for {0} failed")]
ModifyStruct(String),
}
#[cfg(test)]
mod tests {
use super::*;
const fn is_normal<T: Sized + Send + Sync>() {}
#[test]
const fn normal_types() {
is_normal::<Error>();
}
}