Skip to content

Commit

Permalink
Add more helpful error when config file is not found
Browse files Browse the repository at this point in the history
Signed-off-by: Lily Sturmann <[email protected]>
  • Loading branch information
lkatalin committed Aug 5, 2022
1 parent 89fffbc commit 0e55146
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,13 @@ pub(crate) struct KeylimeConfig {
impl KeylimeConfig {
pub fn build() -> Result<Self> {
let conf_name = config_file_get();
let conf = Ini::load_from_file(&conf_name)?;
let conf = match Ini::load_from_file(&conf_name) {
Ok(file) => file,
Err(e) => {
error!("Could not load keylime config file: {} due to error: {}", conf_name, e);
return Err(Error::Ini(e));
}
};

let agent_ip = config_get_env(
&conf_name,
Expand Down

0 comments on commit 0e55146

Please sign in to comment.