mirror of
https://github.com/chatmail/core.git
synced 2026-05-16 21:36:30 +03:00
refactor: return error from export_backup() without logging
The error is logged by `imex` caller.
This commit is contained in:
17
src/imex.rs
17
src/imex.rs
@@ -375,19 +375,10 @@ async fn export_backup(context: &Context, dir: &Path, passphrase: String) -> Res
|
|||||||
dest_path.display(),
|
dest_path.display(),
|
||||||
);
|
);
|
||||||
|
|
||||||
let res = export_backup_inner(context, &temp_db_path, &temp_path).await;
|
export_backup_inner(context, &temp_db_path, &temp_path).await?;
|
||||||
|
fs::rename(temp_path, &dest_path).await?;
|
||||||
match &res {
|
context.emit_event(EventType::ImexFileWritten(dest_path));
|
||||||
Ok(_) => {
|
Ok(())
|
||||||
fs::rename(temp_path, &dest_path).await?;
|
|
||||||
context.emit_event(EventType::ImexFileWritten(dest_path));
|
|
||||||
}
|
|
||||||
Err(e) => {
|
|
||||||
error!(context, "backup failed: {}", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
res
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn export_backup_inner(
|
async fn export_backup_inner(
|
||||||
|
|||||||
Reference in New Issue
Block a user