You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: understandable error message when accounts.lock can't be locked (#6695)
Targets #6636
Right now the error message is:
> Error: Delta Chat is already running. To use Delta Chat, you must
first close the existing Delta Chat process, or restart your device.
>
> (accounts.lock lock file is already locked)
other suggestions welcome!
Copy file name to clipboardExpand all lines: src/accounts.rs
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ use std::collections::BTreeMap;
4
4
use std::future::Future;
5
5
use std::path::{Path,PathBuf};
6
6
7
-
use anyhow::{ensure,Contextas _,Result};
7
+
use anyhow::{bail,ensure,Contextas _,Result};
8
8
use futures::stream::FuturesUnordered;
9
9
use futures::StreamExt;
10
10
use serde::{Deserialize,Serialize};
@@ -73,9 +73,7 @@ impl Accounts {
73
73
let config_file = dir.join(CONFIG_NAME);
74
74
ensure!(config_file.exists(),"{:?} does not exist", config_file);
75
75
76
-
let config = Config::from_file(config_file, writable)
77
-
.await
78
-
.context("failed to load accounts config")?;
76
+
let config = Config::from_file(config_file, writable).await?;
79
77
let events = Events::new();
80
78
let stockstrings = StockStrings::new();
81
79
let push_subscriber = PushSubscriber::new();
@@ -460,7 +458,9 @@ impl Config {
460
458
rx.await?;
461
459
Ok(())
462
460
});
463
-
locked_rx.await?;
461
+
if locked_rx.await.is_err(){
462
+
bail!("Delta Chat is already running. To use Delta Chat, you must first close the existing Delta Chat process, or restart your device. (accounts.lock file is already locked)");
0 commit comments