Skip to content

Commit

Permalink
Improve error message for missing openvasd config
Browse files Browse the repository at this point in the history
  • Loading branch information
Tehforsch committed Dec 13, 2024
1 parent 4553adf commit 6f1ae2d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rust/src/openvasd/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,10 @@ impl Config {

fn from_file<P>(path: P) -> Self
where
P: AsRef<std::path::Path> + std::fmt::Display,
P: AsRef<std::path::Path> + std::fmt::Display + std::fmt::Debug,
{
let config = std::fs::read_to_string(path).unwrap();
let config = std::fs::read_to_string(&path)
.unwrap_or_else(|e| panic!("Failed to read openvasd config from file: {path:?}. {e}"));
toml::from_str(&config).unwrap()
}

Expand Down

0 comments on commit 6f1ae2d

Please sign in to comment.