improvement: more logging

This commit is contained in:
Timo Kösters 2020-11-15 12:17:21 +01:00
parent 9439f2c183
commit 6e36081573
No known key found for this signature in database
GPG key ID: 24DA7517711A2BA4
7 changed files with 26 additions and 11 deletions

View file

@ -39,9 +39,7 @@ impl Database {
/// Tries to remove the old database but ignores all errors.
pub fn try_remove(server_name: &str) -> Result<()> {
let mut path = ProjectDirs::from("xyz", "koesters", "conduit")
.ok_or_else(|| Error::bad_config(
"The OS didn't return a valid home directory path.",
))?
.ok_or_else(|| Error::bad_config("The OS didn't return a valid home directory path."))?
.data_dir()
.to_path_buf();
path.push(server_name);
@ -59,9 +57,9 @@ impl Database {
.map(|x| Ok::<_, Error>(x.to_owned()))
.unwrap_or_else(|_| {
let path = ProjectDirs::from("xyz", "koesters", "conduit")
.ok_or_else(|| Error::bad_config(
"The OS didn't return a valid home directory path.",
))?
.ok_or_else(|| {
Error::bad_config("The OS didn't return a valid home directory path.")
})?
.data_dir()
.join(server_name);