use nibkeep_crypto::CryptoError;
#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum KeysError {
#[error("the passphrase is wrong, or the key file was changed")]
WrongPassphrase,
#[error("the key in the keystore does not open the key file")]
WrongKey,
#[error("the key file is protected another way")]
WrongUnlocker,
#[error("the key file holds no secrets keys")]
NoSecrets,
#[error("the keystore failed: {0}")]
Keystore(#[from] keyring_core::Error),
#[error(transparent)]
Crypto(#[from] CryptoError),
#[error("the key file is damaged: {0}")]
Damaged(String),
#[error(transparent)]
Io(#[from] std::io::Error),
}