Skip to content

Commit a4b71a1

Browse files
refactor(opener): rename to FailedToConvertPathToItemIdList (#2906)
1 parent 4eb36b0 commit a4b71a1

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

plugins/opener/src/error.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ pub enum Error {
3131
Win32Error(#[from] windows::core::Error),
3232
#[error("Path doesn't have a parent: {0}")]
3333
NoParent(PathBuf),
34-
#[error("Path is invalid: {0}")]
35-
InvalidPath(PathBuf),
34+
#[cfg(windows)]
35+
#[error("Failed to convert path '{0}' to ITEMIDLIST")]
36+
FailedToConvertPathToItemIdList(PathBuf),
3637
#[error("Failed to convert path to file:// url")]
3738
FailedToConvertPathToFileUrl,
3839
#[error(transparent)]

plugins/opener/src/reveal_item_in_dir.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,9 @@ mod imp {
169169
let path_hstring = HSTRING::from(path);
170170
let item_id_list = unsafe { ILCreateFromPathW(&path_hstring) };
171171
if item_id_list.is_null() {
172-
Err(crate::Error::InvalidPath(path.to_owned()))
172+
Err(crate::Error::FailedToConvertPathToItemIdList(
173+
path.to_owned(),
174+
))
173175
} else {
174176
Ok(Self {
175177
hstring: path_hstring,

0 commit comments

Comments
 (0)