use anomaly::{BoxError, Context};
use thiserror::Error;
pub type Error = crate::Error<ErrorKind>;
#[derive(Copy, Clone, Debug, Eq, Error, PartialEq)]
pub enum ErrorKind {
#[error("access denied")]
AccessDenied,
#[error("crypto error")]
CryptoError,
#[error("object not found")]
ObjectNotFound,
#[error("unsupported algorithm")]
UnsupportedAlgorithm,
}
impl ErrorKind {
pub fn context(self, source: impl Into<BoxError>) -> Context<ErrorKind> {
Context::new(self, Some(source.into()))
}
}