feat(error): add error handling foundation (Day 0)
- extractErrorMessage(err: unknown) normalizes any error shape to string - handleError/handleInfraError dual utilities (user-facing vs infra-only) - error-classifier extended with ipc/database/filesystem types (9 total) - Toast rate-limiting (max 3 per type per 30s) in notifications store - Infrastructure bridges use documented console.warn (recursion prevention) - 13 new tests for extractErrorMessage
This commit is contained in:
parent
bfc01192d2
commit
dcdb741403
7 changed files with 215 additions and 4 deletions
|
|
@ -11,8 +11,11 @@ export function telemetryLog(
|
|||
message: string,
|
||||
context?: Record<string, unknown>,
|
||||
): void {
|
||||
invoke('frontend_log', { level, message, context: context ?? null }).catch(() => {
|
||||
// Swallow IPC errors — telemetry must never break the app
|
||||
invoke('frontend_log', { level, message, context: context ?? null }).catch((_e: unknown) => {
|
||||
// Intentional: telemetry must never break the app or trigger notification loops.
|
||||
// Cannot use handleInfraError here — it calls tel.error which would recurse.
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn('[telemetry-bridge] IPC failed:', _e);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue