AstrBot-Desktop/src/lib
YokiiroBW e8d9dbc8f6 refactor(ui): share ipc error formatting
Tauri rejects `invoke` with the deserialized Rust error value, which for
`RuntimeCommandError { code, message }` is a plain object rather than an
`Error`. Nine call sites used `reason instanceof Error ? reason.message :
String(reason)`, so every send, reconnect, stop, and settings failure showed
the user `[object Object]`.

`ProfileManager` already had a correct implementation; this lifts it into
`src/lib/errorMessage.ts` and routes the other call sites through it. The
module also exports `isCancelledError`, which a later batch needs to tell a
deliberate stop apart from a real failure.

Refs P1-16 / F-08.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-26 22:31:16 +08:00
..
errorMessage.ts refactor(ui): share ipc error formatting 2026-07-26 22:31:16 +08:00
safeLinkHref.ts fix(chat): restrict markdown link protocols 2026-07-26 22:28:46 +08:00