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 f3d219b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,16 @@ 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 f3d219b

Please sign in to comment.