use thiserror::Error;
use crate::types::key_lifecycle::KeyLifecycleState;
#[derive(Debug, Error)]
#[non_exhaustive]
pub enum TypeError {
#[error("Invalid key state transition: {from:?} -> {to:?}")]
InvalidStateTransition {
from: KeyLifecycleState,
to: KeyLifecycleState,
},
#[error("Configuration error: {0}")]
ConfigurationError(String),
#[error("Unknown encryption scheme: {0}")]
UnknownScheme(String),
#[error("Audit input invalid: {0}")]
InvalidAuditInput(String),
}
pub type Result<T> = std::result::Result<T, TypeError>;