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