资源安装报错

资源安装与队列推送过程中可能出现的报错及说明

本文档汇总 AstroBox 在资源安装、队列推送、插件安装等流程中可能向用户展示的报错信息。


一、Toast 弹窗报错

安装队列通用

触发位置消息 Key说明
pages/queue.tsx:146plugin.install.unsupported非 Tauri 运行时尝试安装插件
pages/plugin/storeDetail.tsx:83plugin.install.unsupported非 Tauri 环境安装插件

安装辅助函数 (installhelper)

触发位置消息说明
logic/queue/installhelper.ts:169queue.watchfaceIdConflict(可附带「覆盖安装」按钮)安装表盘时检测到 downgrade 冲突
logic/queue/installhelper.ts:262device.connect.noDevice无已连接设备
logic/queue/installhelper.ts:448resource.firmware.invalid + 文件名(可附带「继续安装」按钮)固件文件校验失败
logic/queue/installhelper.ts:532resource.unknown.type + 文件名文件扩展名检查不通过
logic/queue/installhelper.ts:555plugin.install.unsupported非 Tauri 环境安装 ABP
logic/queue/installhelper.ts:559resource.unknown.type + 文件名ABP 文件类型不允许
logic/queue/installhelper.ts:572err.messageplugin.install.failedplugsys_install_abp 调用异常
logic/queue/installhelper.ts:619resource.unknown.type + 文件名detectSelectedFileType 返回 undefined
logic/queue/installhelper.ts:623resource.unknown.type + 文件名扩展名检查不通过
logic/queue/installhelper.ts:630plugin.install.unsupportedABP 为 Web File 对象(非路径)

插件操作

触发位置消息说明
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 捕获 action 抛出的异常后,将错误写入任务卡片红色 progressDesc

来源典型错误消息触发场景
installhelper.tsdevice.connect.noDevice安装开始时无设备
installhelper.tsresource.firmware.invalid固件校验失败
installhelper.tsresource.unknown.type + 文件名文件类型未知
installhelper.tsplugin.install.unsupported插件安装不支持
installhelper.tsplugin.install.failedABP 安装调用失败
pluginhelper.tsplugin.install.unsupported插件安装不支持
pluginhelper.tsplugin.install.failed: store base empty插件存储基础为空

三、Rust 后端返回错误

设备安装验证

位置错误消息触发条件
frontapi/device.rs:647device_install: either \data` or `file_path` is required`安装参数缺失
frontapi/device.rs:748device_install: file type mismatch...文件类型不匹配
frontapi/device.rs:764device_install: either \data` or `file_path` is required`安装参数缺失

插件系统

位置错误消息触发条件
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 平台检查
inappbrowser/src/error.rsin-app browser is not supported on this platform浏览器平台检查
cloud-push/src/stub.rscloud push is not supported on this platform云推送不支持

四、WASM / 逻辑层抛错

位置错误消息触发条件
ipc/wasmBridge.ts:106device_install is not implemented for wasm runtimeWASM 不支持 device_install
ipc/wasmBridge.ts:114device_install in wasm runtime requires binary dataWASM install 缺少数据
ipc/wasmBridge.ts:130device_install in wasm runtime expects Uint8Array-compatible dataWASM install 数据类型错误
logic/queue/installhelper.ts:281device.connect.noDevice安装时无设备
logic/queue/pluginhelper.ts:67plugin.install.unsupported插件安装不支持
logic/queue/pluginhelper.ts:70plugin.install.failed: store base empty插件存储基础为空
backendHandlers.ts:220Invalid deeplink payload深度链接 payload 无效
backendHandlers.ts:227Missing resource id or provider深度链接缺少资源 ID 或提供商
backendHandlers.ts:238Missing plugin name深度链接缺少插件名
backendHandlers.ts:243Unknown deeplink target未知深度链接目标

位置错误消息触发条件
local_api/handlers.rs:98missing path资源安装路径缺失
local_api/handlers.rs:109path must be absolute路径非绝对路径
local_api/handlers.rs:119path is not a file路径不是文件
local_api/handlers.rs:154frontend rejected request前端拒绝安装请求
local_api/handlers.rs:164err.to_string()ServerLink 入队错误

六、常见排查建议

报错建议操作
resource.unknown.type确认文件扩展名正确,资源文件未损坏
resource.firmware.invalid确认固件文件完整,或尝试点击「继续安装」
plugin.install.unsupported插件安装仅支持 Tauri 桌面端,Web/WASM 不支持
store base is empty检查插件存储目录权限,或重启 AstroBox
device.connect.noDevice先连接设备再执行安装操作
queue.watchfaceIdConflict确认是否覆盖安装,或更换不同 ID 的表盘
Plugin '{name}' is disabled先启用插件再执行操作
Plugin '{name}' is not loaded检查插件是否正确安装,尝试重新安装

大纲