diff --git a/rust/src/feed/verify/mod.rs b/rust/src/feed/verify/mod.rs index 2b26c092a..8742ed7d1 100644 --- a/rust/src/feed/verify/mod.rs +++ b/rust/src/feed/verify/mod.rs @@ -39,7 +39,7 @@ pub enum Error { #[error("Incorrect feed.")] /// Corrupt sums file SumsFileCorrupt(Hasher), - #[error("Unable to load the file.")] + #[error("Unable to load file: {0}")] /// Unable to load the file LoadError(#[from] LoadError), #[error("Invalid hash for file with key '{key}'. Expected '{expected}', found '{actual}'.")] @@ -164,7 +164,8 @@ where let helper = VHelper::new(gnupghome); let sign_path = path.as_ref().to_path_buf().join("sha256sums.asc"); - let mut sig_file = File::open(sign_path).unwrap(); + let mut sig_file = File::open(&sign_path) + .unwrap_or_else(|e| panic!("Could not find signature at {sign_path:?}. {e}")); let mut signature = Vec::new(); let _ = sig_file.read_to_end(&mut signature); diff --git a/rust/src/openvasd/config.rs b/rust/src/openvasd/config.rs index b71e8905e..35e1fd644 100644 --- a/rust/src/openvasd/config.rs +++ b/rust/src/openvasd/config.rs @@ -333,9 +333,10 @@ impl Config { fn from_file

(path: P) -> Self where - P: AsRef + std::fmt::Display, + P: AsRef + 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() } diff --git a/rust/src/storage/redis/dberror.rs b/rust/src/storage/redis/dberror.rs index 5dd361b76..9a48002f6 100644 --- a/rust/src/storage/redis/dberror.rs +++ b/rust/src/storage/redis/dberror.rs @@ -47,7 +47,7 @@ impl From for DbError { | ErrorKind::InvalidClientConfig | ErrorKind::Moved | ErrorKind::Ask => DbError::ConfigurationError(err.to_string()), - ErrorKind::IoError => DbError::PoisonedLock(err.to_string()), + ErrorKind::IoError => DbError::IoError(err.to_string()), ErrorKind::TypeError | ErrorKind::ClientError | ErrorKind::CrossSlot