zerolaunch_plugin_api/host/
error.rs1use crate::platform::capabilities::PlatformCapability;
2
3#[derive(Debug, thiserror::Error)]
6pub enum HostApiError {
7 #[error("平台不支持该能力: {0:?}")]
9 UnsupportedCapability(PlatformCapability),
10
11 #[error("插件未注册: {0}")]
13 PluginNotRegistered(String),
14
15 #[error("图标提取失败 (请求: {request}): {reason}")]
17 IconExtractionFailed { request: String, reason: String },
18
19 #[error("Shell 操作失败 (目标: {target}): {reason}")]
21 ShellOperationFailed { target: String, reason: String },
22
23 #[error("窗口操作失败: {detail}")]
25 WindowOperationFailed { detail: String },
26
27 #[error("{service} 执行失败: {reason}")]
29 ExecutionFailed { service: String, reason: String },
30
31 #[error("路径解析失败 ({path}): {reason}")]
33 PathResolutionFailed { path: String, reason: String },
34
35 #[error("应用枚举失败: {reason}")]
37 AppEnumerationFailed { reason: String },
38
39 #[error("应用启动失败 (app_id: {app_id}): {reason}")]
41 AppLaunchFailed { app_id: String, reason: String },
42
43 #[error("Lnk 解析失败 ({path}): {reason}")]
45 LnkResolutionFailed { path: String, reason: String },
46
47 #[error("参数解析失败: {reason}")]
49 ParameterResolutionFailed { reason: String },
50
51 #[error("自启动操作失败: {reason}")]
53 AutoStartFailed { reason: String },
54
55 #[error("存储操作失败 ({file}): {reason}")]
57 StorageOperationFailed { file: String, reason: String },
58
59 #[error("资源未找到: {id}")]
61 ResourceNotFound { id: String },
62
63 #[error("路径遍历被拒绝: {path}")]
65 PathTraversalRejected { path: String },
66}