Skip to content

Commit

Permalink
refactor: return error with a cause when failing to export keys
Browse files Browse the repository at this point in the history
  • Loading branch information
link2xt committed Feb 17, 2024
1 parent b35b893 commit 7a1270f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/imex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -389,11 +389,11 @@ async fn imex_inner(

if what == ImexMode::ExportBackup || what == ImexMode::ExportSelfKeys {
// before we export anything, make sure the private key exists
if e2ee::ensure_secret_key_exists(context).await.is_err() {
bail!("Cannot create private key or private key not available.");
} else {
create_folder(context, &path).await?;
}
e2ee::ensure_secret_key_exists(context)
.await
.context("Cannot create private key or private key not available")?;

create_folder(context, &path).await?;
}

match what {
Expand Down

0 comments on commit 7a1270f

Please sign in to comment.