win_context_menu/
error.rs1use std::path::PathBuf;
4
5#[derive(Debug, thiserror::Error)]
7pub enum Error {
8 #[error("COM initialization failed: {0}")]
10 ComInit(windows::core::Error),
11
12 #[error("Failed to parse path to shell item: {path}")]
14 ParsePath {
15 path: PathBuf,
17 #[source]
19 source: windows::core::Error,
20 },
21
22 #[error("Failed to bind to parent shell folder: {0}")]
24 BindToParent(windows::core::Error),
25
26 #[error("Selected paths do not share a common parent folder")]
28 NoCommonParent,
29
30 #[error("Failed to get context menu interface: {0}")]
32 GetContextMenu(windows::core::Error),
33
34 #[error("QueryContextMenu failed: {0}")]
36 QueryContextMenu(windows::core::Error),
37
38 #[error("TrackPopupMenu failed: {0}")]
40 TrackPopupMenu(windows::core::Error),
41
42 #[error("Failed to invoke command: {0}")]
44 InvokeCommand(windows::core::Error),
45
46 #[error("Failed to get command string: {0}")]
48 GetCommandString(windows::core::Error),
49
50 #[error("Failed to get menu item info: {0}")]
52 GetMenuItemInfo(windows::core::Error),
53
54 #[error("Failed to create hidden window: {0}")]
56 CreateWindow(windows::core::Error),
57
58 #[error("Failed to register window class: {0}")]
60 RegisterClass(windows::core::Error),
61
62 #[error("Windows API error: {0}")]
64 Windows(#[from] windows::core::Error),
65}
66
67pub type Result<T> = std::result::Result<T, Error>;