Skip to content

Commit

Permalink
feat: display config file path in error
Browse files Browse the repository at this point in the history
  • Loading branch information
aidanaden committed Jun 20, 2024
1 parent ba276e6 commit ff41016
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion rm-config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ impl Config {
XDG_DIRS.get_or_init(|| xdg::BaseDirectories::with_prefix("rustmission").unwrap())
}

fn get_config_path() -> &'static PathBuf {
pub fn get_config_path() -> &'static PathBuf {
CONFIG_PATH.get_or_init(|| {
Self::get_xdg_dirs()
.place_config_file("config.toml")
Expand Down
4 changes: 2 additions & 2 deletions rm-main/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ impl Ctx {
});
}
Err(e) => {
let url = config.connection.url;
let config_path = Config::get_config_path().to_str().unwrap();
return Err(Error::msg(format!(
"{e}\nIs the connection info in {url} correct?"
"{e}\nIs the connection info in {config_path} correct?"
)));
}
}
Expand Down

0 comments on commit ff41016

Please sign in to comment.