设置与工具报错

设置页面、高级工具、文件选择器等可能出现的报错及说明

本文档汇总 AstroBox 在设置页面、高级工具、文件选择器、缓存清理、传输诊断等流程中可能向用户展示的报错信息。


一、Toast 弹窗报错

通用设置

触发位置消息 Key说明
pages/settings/general.tsx:281settings.general.runtimeCache.success + 清理大小运行时缓存清理成功
pages/settings/general.tsx:288settings.general.runtimeCache.failed + 错误消息运行时缓存清理失败

网络设置

触发位置消息 Key说明
pages/settings/networkShared.tsx:495settings.network.proMirrorLocked非 Pro 用户选择 Pro CDN
pages/settings/networkShared.tsx:522settings.network.doh.invalidCustomUrlDOH 配置写入失败
pages/settings/networkShared.tsx:549settings.network.doh.invalidCustomUrl自定义 DOH URL 无效
pages/settings/networkShared.tsx:577settings.network.doh.invalidCustomUrl选择自定义 DOH 时 URL 无效
pages/settings/networkShared.tsx:590settings.network.doh.invalidCustomUrl提交自定义 DOH URL 为空/无效
pages/settings/networkShared.tsx:636settings.network.speedTest.completed至少一个测速探针成功
pages/settings/networkShared.tsx:638settings.network.speedTest.failed所有探针超时/失败
pages/settings/networkShared.tsx:726settings.network.speedTest.noAvailableResult无成功测速结果
pages/settings/networkShared.tsx:734settings.network.speedTest.applied最佳 CDN/源已应用

通知设置

触发位置消息 Key说明
pages/settings/notifications.tsx:108settings.notifications.remotePush.updateFailed + error推送通道更新失败
pages/settings/notifications.tsx:123settings.notifications.remotePush.enableSuccess推送注册成功
pages/settings/notifications.tsx:126settings.notifications.remotePush.permissionDenied推送权限被拒绝
pages/settings/notifications.tsx:129settings.notifications.remotePush.enableFailed + result推送注册其他失败
pages/settings/notifications.tsx:136settings.notifications.remotePush.disableSuccess推送注销成功
pages/settings/notifications.tsx:139settings.notifications.remotePush.enableFailed + error推送注销失败

高级工具

触发位置消息 Key说明
pages/settings/extratools.tsx:684settings.extratools.logsShareFailed + message日志归档分享失败
pages/settings/extratools.tsx:695device.noDevice打开设备信息时无设备地址
pages/settings/extratools.tsx:899common.copied设备信息复制成功
pages/settings/extratools.tsx:902common.copyFailed设备信息复制失败
pages/settings/extratools.tsx:934device.noDevice开始传输抓包时无连接设备
pages/settings/extratools.tsx:944settings.extratools.transportDiag.captureStarted传输抓包已开始
pages/settings/extratools.tsx:948message(归一化错误)传输抓包启动失败
pages/settings/extratools.tsx:956device.noDevice停止传输抓包时无设备地址
pages/settings/extratools.tsx:971settings.extratools.transportDiag.captureStopped传输抓包已停止
pages/settings/extratools.tsx:975message(归一化错误)传输抓包停止失败
pages/settings/extratools.tsx:983device.noDevice运行传输冒烟测试时无连接设备
pages/settings/extratools.tsx:1006settings.extratools.transportDiag.smokeFinished传输冒烟测试完成
pages/settings/extratools.tsx:1010message(归一化错误)传输冒烟测试失败
pages/settings/extratools.tsx:1022common.copied传输报告复制成功
pages/settings/extratools.tsx:1025common.copyFailed传输报告复制失败
pages/settings/extratools.tsx:1031settings.extratools.watchfacePreview.nativeOnly非 Tauri 运行时打开表盘预览
pages/settings/extratools.tsx:1058device.noDevice获取设备日志时无连接设备
pages/settings/extratools.tsx:1093settings.extratools.fetchLogs + 保存路径桌面端日志获取成功
pages/settings/extratools.tsx:1099error.message / String(error)日志获取失败
pages/settings/extratools.tsx:1267device.noDevice传输诊断弹窗刷新时无连接设备

原生 alert(唯一一处)

触发位置消息说明
pages/settings/extratools.tsx:644Failed to open debugwindow:${message}debug window 打开失败(阻断式弹窗)

录音导出

触发位置消息 Key说明
pages/device/record.tsx:230device.record.exportSuccessTo + 文件数 + 目录非移动端导出成功
pages/device/record.tsx:242error.message / String(error)导出失败(非分享取消)

二、Rust 后端返回错误

文件选择器

位置错误消息触发条件
frontapi/file_picker.rs:152folder picker is not implemented on mobile移动端文件夹选择
frontapi/file_picker.rs:211message.to_string()桌面文件选择器错误
frontapi/file_picker.rs:222message.to_string()桌面文件夹选择器错误
frontapi/file_picker.rs:338error stringmacOS 文件选择器错误
frontapi/file_picker.rs:360messageAndroid 文件选择器错误
frontapi/file_picker.rs:377messageiOS 文件选择器错误
frontapi/file_picker.rs:453folder picker is not implemented on iOSiOS 文件夹选择
frontapi/file_picker.rs:496failed to launch iOS native file pickeriOS 文件选择器启动失败
frontapi/file_picker.rs:532erroriOS 文件选择器结果错误

网络/HTTP 代理

位置错误消息触发条件
frontapi/network.rs:226invalid http method: method is emptyHTTP 方法为空
frontapi/network.rs:281invalid http method: {method}HTTP 方法不支持
frontapi/network.rs:392body_text and body_json are mutually exclusive请求体验证

分享与缓存

位置错误消息触发条件
frontapi/app.rs:543sharing is not supported on this platform原生文件分享不支持
frontapi/app.rs:624failed to allocate a unique share cache file path分享缓存路径分配失败
frontapi/app.rs:727Android 原生分享启动失败Android 分享启动失败
frontapi/app.rs:740拉起系统分享超时分享超时
frontapi/app.rs:769无法拉起系统分享分享失败
frontapi/app.rs:779当前系统不支持原生文件分享平台不支持分享
frontapi/app.rs:334failed to clear cache: {failures}运行时缓存清理失败

录音导出

位置错误消息触发条件
frontapi/device/record.rs:114{err:#}录音导出错误
frontapi/device/record.rs:118Record export response not received: {err:?}录音导出响应未收到
frontapi/device/record.rs:122Record export request timed out录音导出请求超时
frontapi/device/record.rs:161No recordings selected未选择录音
frontapi/device/record.rs:281No recording export task completed successfully所有导出失败
frontapi/device/record.rs:296{err:#}主要导出错误
frontapi/device/record.rs:331{err:#}录音获取错误
frontapi/device/record.rs:334{label} response not received: {err:?}录音获取响应未收到
frontapi/device/record.rs:338{label} request timed out录音获取超时
frontapi/device/record.rs:477{err:#}分享导出错误
frontapi/device/record.rs:483{label} response not received: {err:?}分享响应未收到
frontapi/device/record.rs:489Timed out while exporting recordings for sharing分享导出超时
frontapi/device/record.rs:511Recording `{name}` cannot be exported不支持的录音格式

三、WASM / 逻辑层抛错

位置错误消息触发条件
logic/filePicker.ts:144filePicker.openFailed: ${detail} / filePicker.openFailed文件选择器打开失败
logic/share.ts:59settings.extratools.logsShareUnsupported日志分享不支持
logic/share.ts:76settings.extratools.logsShareUnsupported日志分享不支持
logic/networkSettings.ts:186invalid-custom-doh-url自定义 DOH URL 无效
logic/networkHttp.ts:395persistTempDownload is only available in Tauri runtime非 Tauri 调用
logic/networkHttp.ts:407deleteTempDownload is only available in Tauri runtime非 Tauri 调用
pages/settings/extratools.tsx:351clipboard unavailable剪贴板不可用

四、常见排查建议

报错建议操作
device.noDevice先连接设备再执行相关操作
settings.network.doh.invalidCustomUrl确认 DOH URL 格式正确,以 https:// 开头
settings.network.speedTest.failed检查网络连接,或切换其他网络后重试
settings.notifications.remotePush.permissionDenied在系统设置中开启推送权限
settings.extratools.watchfacePreview.nativeOnly表盘预览仅支持 Tauri 桌面端
folder picker is not implemented on mobile移动端不支持文件夹选择,使用文件选择
sharing is not supported on this platform当前平台不支持系统分享功能
failed to clear cache检查存储权限,或手动清理缓存目录
clipboard unavailable检查浏览器/系统剪贴板权限
Failed to open debugwindow检查窗口管理器权限,或重启应用
Recording ... cannot be exported该录音格式不支持导出,尝试其他方式

大纲