Skip to content

Commit 81300ea

Browse files
committed
Move error into create_lock_task()
1 parent 142a99c commit 81300ea

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/accounts.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,9 @@ impl Config {
458458
rx.await?;
459459
Ok(())
460460
});
461-
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)");
463+
};
462464
Ok(Some(lock_task))
463465
}
464466

@@ -478,9 +480,7 @@ impl Config {
478480
};
479481
return Ok(cfg);
480482
}
481-
let Ok(lock_task) = Self::create_lock_task(dir.to_path_buf()).await else {
482-
bail!("Delta Chat is already running. To use Delta Chat, you must first close the existing Delta Chat process, or restart your device.\n\n(accounts.lock file is already locked)");
483-
};
483+
let lock_task = Self::create_lock_task(dir.to_path_buf()).await?;
484484
let cfg = Self {
485485
file,
486486
inner,

0 commit comments

Comments
 (0)