diff --git a/Cargo.lock b/Cargo.lock index 4c12c64..ac21914 100755 --- a/Cargo.lock +++ b/Cargo.lock @@ -371,7 +371,7 @@ dependencies = [ [[package]] name = "trasher" -version = "1.3.2" +version = "1.3.3" dependencies = [ "base64", "chrono", diff --git a/Cargo.toml b/Cargo.toml index f22b3a2..3597cf9 100755 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "trasher" -version = "1.3.2" +version = "1.3.3" authors = ["Clément Nerma "] edition = "2018" license = "Apache-2.0" diff --git a/src/actions.rs b/src/actions.rs index 251dc6f..ba1ca16 100644 --- a/src/actions.rs +++ b/src/actions.rs @@ -1,5 +1,6 @@ use std::fs; use std::path::PathBuf; +use std::io::ErrorKind; use super::{debug, fail}; use super::command::*; use super::items::*; @@ -105,8 +106,12 @@ pub fn remove(action: &MoveToTrash) { if let Err(err) = fs::rename(&path, &trash_item_path) { debug!("Renaming failed: {:?}", err); + if err.kind() != ErrorKind::Other { + fail!("An error occured while trying to move item to trash: {}", err); + } + if !move_ext_filesystems { - fail!("Failed to move item to trash: {}", err); + fail!("Failed to move item to trash: {}\nHelp: Item may be located on another drive, try with '--move-ext-filesystems'.", err); } debug!("Falling back to copying.");