mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-04-25 11:46:06 +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),
|
||||
#[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)]
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user