1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use displaydoc::Display;
use thiserror::Error;

/// Cache error
#[non_exhaustive]
#[derive(Display, Error, Debug, Clone)]
pub enum CacheError {
    /// VM error: {0}
    VMError(String),
    /// Load error: {0}
    LoadError(String),
}

impl From<anyhow::Error> for CacheError {
    fn from(e: anyhow::Error) -> CacheError {
        CacheError::VMError(e.to_string())
    }
}