use thiserror::Error;
#[derive(Error, Debug)]
pub enum Error {
#[error("IO error: {0}")]
IoError(#[from] std::io::Error),
#[error("TOML parse error: {0}")]
TomlParseError(#[from] toml::de::Error),
#[error("Encipher key must be 16 bytes, got {0} bytes")]
InvalidEncipherKey(usize),
#[error("No [General] section found in config file")]
MissingGeneralSection,
#[error("Invalid backend configuration for backend type: {0}")]
InvalidBackendConfig(String),
#[error("JSON error: {0}")]
JsonError(#[from] serde_json::Error),
#[error("Base64 decode error: {0}")]
Base64DecodeError(#[from] base64::DecodeError),
#[error("Encryption error: {0}")]
EncryptionError(String),
#[error("Decryption error: {0}")]
DecryptionError(String),
#[error("Load config error: {0}")]
LoadConfigError(String),
}