use thiserror::Error;
#[derive(Error, Debug)]
pub enum SmartPassError {
#[error("Secret phrase must be at least 12 characters. Current: {0}")]
SecretTooShort(usize),
#[error("Password length must be between {min} and {max}. Current: {current}")]
InvalidPasswordLength {
min: usize,
max: usize,
current: usize,
},
#[error("Code length must be between 4 and 100. Current: {0}")]
InvalidCodeLength(usize),
#[error("Public key cannot be empty")]
EmptyPublicKey,
#[error("Description cannot be empty")]
EmptyDescription,
#[error("Crypto error: {0}")]
CryptoError(String),
#[error("IO error: {0}")]
IoError(#[from] std::io::Error),
#[error("Serialization error: {0}")]
SerializationError(#[from] serde_json::Error),
#[error("Hex error: {0}")]
HexError(#[from] hex::FromHexError),
}
pub type Result<T> = std::result::Result<T, SmartPassError>;