1use std::fmt;
2
3#[derive(Debug)]
5pub enum MapError {
6 LockError,
8 KeyNotFound(String),
10 TypeMismatch,
12}
13
14impl fmt::Display for MapError {
15 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
16 match self {
17 MapError::LockError => write!(f, "Failed to acquire lock"),
18 MapError::KeyNotFound(key) => write!(f, "Key not found in store: {}", key),
19 MapError::TypeMismatch => write!(f, "Type mismatch for the requested key"),
20 }
21 }
22}
23
24impl std::error::Error for MapError {}