插件系统报错

插件安装、启用、禁用、卸载过程中可能出现的报错及说明

本文档汇总 AstroBox 在插件安装、管理、运行等流程中可能向用户展示的报错信息。


一、Toast 弹窗报错

插件安装

触发位置消息 Key说明
queue.tsx:146plugin.install.unsupported非 Tauri 运行时安装插件
pages/plugin/storeDetail.tsx:83plugin.install.unsupported非 Tauri 环境安装插件
logic/queue/pluginhelper.ts:91plugin.install.success插件下载并安装成功

插件操作

触发位置消息说明
pages/plugin/detail.tsx:344plugin.action.enableFailed启用插件失败
pages/plugin/detail.tsx:350plugin.action.disableFailed禁用插件失败
pages/plugin/detail.tsx:356err.message / plugin.action.updateFailed插件状态切换失败
pages/plugin/detail.tsx:375plugin.action.uninstallFailed卸载插件失败
pages/plugin/detail.tsx:388err.message / plugin.action.uninstallFailed卸载插件失败

二、队列内嵌报错(progressDesc)

taskList.ts 捕获插件任务异常后写入任务卡片:

来源典型错误消息触发场景
pluginhelper.tsplugin.install.unsupported插件安装不支持
pluginhelper.tsplugin.install.failed: store base empty插件存储基础为空

三、Rust 后端返回错误

插件系统核心

位置错误消息触发条件
frontapi/plugsys.rs:224invalid path component in `{relative_path}`插件路径验证
frontapi/plugsys.rs:284store base is empty插件存储验证
frontapi/plugsys.rs:325manifest entry is empty插件清单验证
frontapi/plugsys.rs:474Failed to remove plugin directory: {err}插件目录移除
frontapi/plugsys.rs:492Invalid folder name: path traversal detected路径遍历检测
frontapi/plugsys.rs:517Failed to remove plugin directory: {err}插件目录移除
frontapi/plugsys.rs:566Plugin '{name}' is disabled插件启动验证
frontapi/plugsys.rs:570err.to_string()插件启动失败
frontapi/plugsys.rs:577Plugin '{name}' is not loaded插件未加载
frontapi/plugsys.rs:602Plugin '{name}' is disabled插件 UI 打开验证
frontapi/plugsys.rs:606err.to_string()插件 UI 打开失败
frontapi/plugsys.rs:613Plugin '{name}' is not loaded插件 UI 打开验证
frontapi/plugsys.rs:644Plugin '{name}' is not ready插件 RPC 验证
frontapi/plugsys.rs:673Plugin '{name}' is not ready插件状态验证

插件平台 Stub

插件错误消息触发条件
iap/src/error.rsIAP is not supported on this platformIAP 平台检查
iap/src/stub.rsErr(Error::UnsupportedPlatform)不支持平台的所有 IAP 操作
inappbrowser/src/error.rsin-app browser is not supported on this platform浏览器平台检查
inappbrowser/src/stub.rsErr(Error::UnsupportedPlatform)不支持平台的所有浏览器操作
cloud-push/src/stub.rscloud push is not supported on this platform云推送不支持
live-activity/src/error.rsError::Io(...) / Error::PluginInvoke(...)实时活动序列化错误

四、WASM / 逻辑层抛错

位置错误消息触发条件
logic/queue/pluginhelper.ts:67plugin.install.unsupported插件安装不支持
logic/queue/pluginhelper.ts:70plugin.install.failed: store base empty插件存储基础为空
logic/pluginMarket.ts:308aggregate index.json does not contain valid plugins插件市场聚合索引无效
ipc/wasmBridge.ts:99thirdpartyapp_install_by_url is not implemented for wasm runtimeWASM 不支持
ipc/wasmBridge.ts:101thirdpartyapp_stop_install_by_url is not implemented for wasm runtimeWASM 不支持
ipc/wasmBridge.ts:103thirdpartyapp_cancel_install_by_url is not implemented for wasm runtimeWASM 不支持

五、常见排查建议

报错建议操作
plugin.install.unsupported插件安装仅支持 Tauri 桌面端,Web/WASM 不支持
store base is empty检查插件存储目录权限,或重启 AstroBox
Plugin '{name}' is disabled先启用插件再执行操作
Plugin '{name}' is not loaded检查插件是否正确安装,尝试重新安装
Plugin '{name}' is not ready等待插件初始化完成,或重启应用
manifest entry is empty插件包可能损坏,尝试重新下载安装
Invalid folder name: path traversal detected插件包包含非法路径,联系插件作者
aggregate index.json does not contain valid plugins插件市场源配置错误,检查源地址
IAP is not supported on this platform内购功能在当前平台不可用

大纲