#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("{0}")]
Crypto(#[from] crypto::Error),
#[error("stronghold client error: {0}")]
Client(#[from] iota_stronghold::ClientError),
#[error("invalid stronghold password")]
InvalidPassword,
#[error("invalid json {0}")]
Json(#[from] serde_json::Error),
#[error("no password has been supplied, or the key has been cleared from the memory")]
KeyCleared,
#[error("stronghold memory error: {0}")]
Memory(#[from] iota_stronghold::MemoryError),
#[error("a mnemonic has already been stored in the Stronghold vault")]
MnemonicAlreadyStored,
#[error("no mnemonic has been stored into the Stronghold vault")]
MnemonicMissing,
#[error("stronghold reported a procedure error: {0}")]
Procedure(#[from] iota_stronghold::procedures::ProcedureError),
#[error("invalid mnemonic {0}")]
InvalidMnemonic(String),
#[error("unsupported snapshot version, expected {expected}, found {found}, migration required")]
UnsupportedSnapshotVersion {
found: u16,
expected: u16,
},
#[error("stronghold migration error: {0}")]
Migration(#[from] iota_stronghold::engine::snapshot::migration::Error),
#[error("invalid number of hash rounds: {0}")]
InvalidRounds(u32),
#[error("path already exists: {0}")]
PathAlreadyExists(std::path::PathBuf),
#[error("io error: {0}")]
Io(#[from] std::io::Error),
}