Skip to content

Commit

Permalink
main: Use more descriptive message for missing files error
Browse files Browse the repository at this point in the history
Use more descriptive message when required paths are missing instead of
the generic message.

Signed-off-by: Anderson Toshiyuki Sasaki <[email protected]>
  • Loading branch information
ansasaki committed Jun 28, 2022
1 parent dbefd86 commit fb11761
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -608,9 +608,22 @@ async fn main() -> Result<()> {
let payload = Arc::clone(&encr_payload_arc);

let revocation_cert = revocation::get_revocation_cert_path(&config)?;
let actions_dir =
Path::new(&config.revocation_actions_dir).canonicalize()?;
let work_dir = Path::new(&config.work_dir).canonicalize()?;
let actions_dir = Path::new(&config.revocation_actions_dir)
.canonicalize()
.or_else(|e| {
Err(Error::Configuration(format!(
"Path {} set in revocation_actions_dir not found: {}",
&config.revocation_actions_dir, e
)))
})?;

let work_dir =
Path::new(&config.work_dir).canonicalize().or_else(|e| {
Err(Error::Configuration(format!(
"Path {} set in keylime_dir not found: {}",
&config.work_dir, e
)))
})?;

let quotedata = web::Data::new(QuoteData {
tpmcontext: Mutex::new(ctx),
Expand Down

0 comments on commit fb11761

Please sign in to comment.