Skip to content

Commit 34c6455

Browse files
committed
Fix: display right error message on non-extfs errors
1 parent fbb29e9 commit 34c6455

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "trasher"
3-
version = "1.3.2"
3+
version = "1.3.3"
44
authors = ["Clément Nerma <[email protected]>"]
55
edition = "2018"
66
license = "Apache-2.0"

src/actions.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use std::fs;
22
use std::path::PathBuf;
3+
use std::io::ErrorKind;
34
use super::{debug, fail};
45
use super::command::*;
56
use super::items::*;
@@ -105,8 +106,12 @@ pub fn remove(action: &MoveToTrash) {
105106
if let Err(err) = fs::rename(&path, &trash_item_path) {
106107
debug!("Renaming failed: {:?}", err);
107108

109+
if err.kind() != ErrorKind::Other {
110+
fail!("An error occured while trying to move item to trash: {}", err);
111+
}
112+
108113
if !move_ext_filesystems {
109-
fail!("Failed to move item to trash: {}", err);
114+
fail!("Failed to move item to trash: {}\nHelp: Item may be located on another drive, try with '--move-ext-filesystems'.", err);
110115
}
111116

112117
debug!("Falling back to copying.");

0 commit comments

Comments
 (0)