diff --git a/plugins/opener/src/error.rs b/plugins/opener/src/error.rs index 36d781b44c..c5a4dde3cc 100644 --- a/plugins/opener/src/error.rs +++ b/plugins/opener/src/error.rs @@ -31,8 +31,9 @@ pub enum Error { Win32Error(#[from] windows::core::Error), #[error("Path doesn't have a parent: {0}")] NoParent(PathBuf), - #[error("Path is invalid: {0}")] - InvalidPath(PathBuf), + #[cfg(windows)] + #[error("Failed to convert path '{0}' to ITEMIDLIST")] + FailedToConvertPathToItemIdList(PathBuf), #[error("Failed to convert path to file:// url")] FailedToConvertPathToFileUrl, #[error(transparent)] diff --git a/plugins/opener/src/reveal_item_in_dir.rs b/plugins/opener/src/reveal_item_in_dir.rs index 1cea2641db..6112fb8b19 100644 --- a/plugins/opener/src/reveal_item_in_dir.rs +++ b/plugins/opener/src/reveal_item_in_dir.rs @@ -169,7 +169,9 @@ mod imp { let path_hstring = HSTRING::from(path); let item_id_list = unsafe { ILCreateFromPathW(&path_hstring) }; if item_id_list.is_null() { - Err(crate::Error::InvalidPath(path.to_owned())) + Err(crate::Error::FailedToConvertPathToItemIdList( + path.to_owned(), + )) } else { Ok(Self { hstring: path_hstring,