Skip to content

Commit

Permalink
fix: simplify error handling for invalid password
Browse files Browse the repository at this point in the history
  • Loading branch information
ttys3 authored and marcospb19 committed Sep 7, 2024
1 parent c3e37e2 commit a3d4f6a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/archive/sevenz.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ where
Some(password) => sevenz_rust::decompress_with_extract_fn_and_password(
reader,
output_path,
sevenz_rust::Password::from(password.to_str().map_err(|_| Error::InvalidPassword {
reason: "7z requires that all passwords are valid UTF-8".to_string(),
sevenz_rust::Password::from(password.to_str().map_err(|err| Error::InvalidPassword {
reason: err.to_string(),
})?),
entry_extract_fn,
)?,
Expand Down

0 comments on commit a3d4f6a

Please sign in to comment.