pub enum VaultError {
NoPassword,
InvalidFormat,
VaultIdNotFound,
DecryptionFailed,
EncryptionFailed,
}Expand description
Specialized error types for Ansible Vault operations.
These errors provide specific context for vault-related failures, making it easier to handle different types of vault errors appropriately.
§Examples
use ansible::{VaultError, AnsibleError};
// Handle specific vault errors
let vault_result: Result<(), AnsibleError> = Ok(());
match vault_result {
Err(AnsibleError::ConfigError(message)) if message.contains("password") => {
eprintln!("Please provide a vault password");
}
Err(AnsibleError::CommandFailed { message, .. }) if message.contains("decrypt") => {
eprintln!("Failed to decrypt - check your password");
}
_ => {}
}Variants§
NoPassword
Vault password was not provided when required
This error occurs when attempting vault operations without specifying a password file, vault ID, or interactive password.
InvalidFormat
The vault file has an invalid or corrupted format
This error occurs when the encrypted file doesn’t match the expected Ansible Vault format.
VaultIdNotFound
The specified vault ID was not found
This error occurs when using multiple vault IDs and the specified ID is not available or configured.
DecryptionFailed
Decryption operation failed
This error occurs when the vault password is incorrect or the encrypted data is corrupted.
EncryptionFailed
Encryption operation failed
This error occurs when the encryption process fails, possibly due to file permissions or disk space issues.
Trait Implementations§
Source§impl Clone for VaultError
impl Clone for VaultError
Source§fn clone(&self) -> VaultError
fn clone(&self) -> VaultError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more