Skip to content

Commit

Permalink
Improve error reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
ClementNerma committed Dec 19, 2023
1 parent fe670fd commit d3ca400
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "trasher"
version = "3.1.6"
version = "3.1.7"
authors = ["Clément Nerma <clement.nerma@gmail.com>"]
edition = "2021"
license = "Apache-2.0"
Expand Down
7 changes: 4 additions & 3 deletions src/fsutils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ pub fn list_trash_items(trash_dir: &Path) -> Result<Vec<TrashedItem>> {
.into_iter()
.filter_map(|item| {
match item.file_name().into_string() {
Err(invalid_filename) => eprintln!(
Err(_) => eprintln!(
"WARN: Trash item '{}' does not have a valid UTF-8 filename!",
invalid_filename.to_string_lossy()
item.path().display()
),

Ok(filename) => {
Expand All @@ -127,8 +127,9 @@ pub fn list_trash_items(trash_dir: &Path) -> Result<Vec<TrashedItem>> {
Err(err) => {
eprintln!(
"WARN: Trash item '{}' does not have a valid trash filename!",
filename
item.path().display()
);

super::debug!("Invalid trash item filename: {:?}", err);
}

Expand Down

0 comments on commit d3ca400

Please sign in to comment.