use thiserror::Error;
#[derive(Debug, Error)]
pub enum Error {
#[error("io: {0}")]
Io(#[from] std::io::Error),
#[error("parse: {0}")]
Parse(String),
#[error("invalid CSR: {0}")]
InvalidCsr(String),
#[error("profile violation: {0}")]
Profile(String),
#[error("authentication failed: {0}")]
Auth(String),
#[error("cms: {0}")]
Cms(String),
#[cfg(feature = "client")]
#[error("http: {0}")]
Http(#[from] reqwest::Error),
#[error("ca: {0}")]
Ca(String),
#[error("unexpected: {0}")]
Unexpected(String),
}
pub type Result<T, E = Error> = std::result::Result<T, E>;