test: improve vault password file errors by propagating up

This commit is contained in:
2026-06-04 15:32:31 -06:00
parent b1696c3425
commit e54a2e42c9
9 changed files with 243 additions and 29 deletions
+3 -4
View File
@@ -80,7 +80,7 @@ impl Vault {
}
}
pub fn init(config: &AppConfig) -> Self {
pub fn init(config: &AppConfig) -> Result<Self> {
let mut provider = match &config.secrets_provider {
Some(p) => p.clone(),
None => SupportedProvider::Local {
@@ -92,11 +92,10 @@ impl Vault {
};
if let SupportedProvider::Local { provider_def } = &mut provider {
ensure_password_file_initialized(provider_def)
.expect("Failed to initialize password file");
ensure_password_file_initialized(provider_def)?;
}
Self { provider }
Ok(Self { provider })
}
pub fn local_password_file(&self) -> Result<PathBuf> {