use thiserror::Error;
#[derive(Debug, Error)]
pub enum SecretClientError {
#[error("secret not found: {0}")]
NotFound(String),
#[error("json error: {0}")]
Json(#[from] serde_json::Error),
#[error("io error: {0}")]
Io(#[from] std::io::Error),
#[error("unexpected: {0}")]
Unexpected(String),
#[error("other error: {0}")]
Other(String),
}
impl From<String> for SecretClientError {
fn from(msg: String) -> Self {
SecretClientError::Other(msg)
}
}
impl From<&str> for SecretClientError {
fn from(msg: &str) -> Self {
SecretClientError::Other(msg.to_string())
}
}