mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-09-26 21:41:48 +02:00
refactor(opener): rename to FailedToConvertPathToItemIdList (#2906)
This commit is contained in:
@@ -31,8 +31,9 @@ pub enum Error {
|
|||||||
Win32Error(#[from] windows::core::Error),
|
Win32Error(#[from] windows::core::Error),
|
||||||
#[error("Path doesn't have a parent: {0}")]
|
#[error("Path doesn't have a parent: {0}")]
|
||||||
NoParent(PathBuf),
|
NoParent(PathBuf),
|
||||||
#[error("Path is invalid: {0}")]
|
#[cfg(windows)]
|
||||||
InvalidPath(PathBuf),
|
#[error("Failed to convert path '{0}' to ITEMIDLIST")]
|
||||||
|
FailedToConvertPathToItemIdList(PathBuf),
|
||||||
#[error("Failed to convert path to file:// url")]
|
#[error("Failed to convert path to file:// url")]
|
||||||
FailedToConvertPathToFileUrl,
|
FailedToConvertPathToFileUrl,
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
|
|||||||
@@ -169,7 +169,9 @@ mod imp {
|
|||||||
let path_hstring = HSTRING::from(path);
|
let path_hstring = HSTRING::from(path);
|
||||||
let item_id_list = unsafe { ILCreateFromPathW(&path_hstring) };
|
let item_id_list = unsafe { ILCreateFromPathW(&path_hstring) };
|
||||||
if item_id_list.is_null() {
|
if item_id_list.is_null() {
|
||||||
Err(crate::Error::InvalidPath(path.to_owned()))
|
Err(crate::Error::FailedToConvertPathToItemIdList(
|
||||||
|
path.to_owned(),
|
||||||
|
))
|
||||||
} else {
|
} else {
|
||||||
Ok(Self {
|
Ok(Self {
|
||||||
hstring: path_hstring,
|
hstring: path_hstring,
|
||||||
|
|||||||
Reference in New Issue
Block a user