mirror of
https://github.com/chatmail/core.git
synced 2026-05-19 06:46:32 +03:00
refactor: return error with a cause when failing to export keys
This commit is contained in:
10
src/imex.rs
10
src/imex.rs
@@ -389,11 +389,11 @@ async fn imex_inner(
|
|||||||
|
|
||||||
if what == ImexMode::ExportBackup || what == ImexMode::ExportSelfKeys {
|
if what == ImexMode::ExportBackup || what == ImexMode::ExportSelfKeys {
|
||||||
// before we export anything, make sure the private key exists
|
// before we export anything, make sure the private key exists
|
||||||
if e2ee::ensure_secret_key_exists(context).await.is_err() {
|
e2ee::ensure_secret_key_exists(context)
|
||||||
bail!("Cannot create private key or private key not available.");
|
.await
|
||||||
} else {
|
.context("Cannot create private key or private key not available")?;
|
||||||
create_folder(context, &path).await?;
|
|
||||||
}
|
create_folder(context, &path).await?;
|
||||||
}
|
}
|
||||||
|
|
||||||
match what {
|
match what {
|
||||||
|
|||||||
Reference in New Issue
Block a user