Skip to content

fix(desktop): hide raw renderer exceptions - #4459

Open
orangeCatDeveloper wants to merge 1 commit into
apache:mainfrom
orangeCatDeveloper:fix/desktop-error-boundary
Open

fix(desktop): hide raw renderer exceptions#4459
orangeCatDeveloper wants to merge 1 commit into
apache:mainfrom
orangeCatDeveloper:fix/desktop-error-boundary

Conversation

@orangeCatDeveloper

Copy link
Copy Markdown
Contributor

Part of #2672

Summary

Unexpected renderer and startup failures show raw exception text as product copy: the crash surface renders the exception and component stack into the window, and native startup dialogs interpolate error.message into their detail text — unlocalized, unstable, and occasionally containing content that belongs only in a diagnostic report.

Raw exceptions are diagnostic data, not stable product copy. The crash surface and the native diagnostic dialogs now show fixed localized recovery guidance from typed catalogs (error-boundary-copy.ts, native-diagnostic-dialog-copy.ts), while the raw details keep flowing through the existing diagnostics channel — the copyable report still carries the full redacted stack. The last locale === ternary block in runtime-host-boot.ts moves into the catalog with the rest, and the shell toast action reads its label from the error-boundary catalog, retiring the now-dead errorBoundary group in shell-copy.ts.

Scope note: this covers the generic surfaces only; expected-error localization by error code is a sibling PR, and the copy-boundary gate expansion for these files lands with the CLI ratchet PR.

Verification

Before (dialog detail carries the raw exception; fallback renders the stack)
runtime-host-boot.ts:  detail: isChinese ? `${input.error.message}\n\n你可以重试…` : `${input.error.message}\n\nRetry…`
error-boundary.tsx:    <pre className="maka-error-stack">{safeStack}</pre>

After (fixed localized guidance; raw error only in the diagnostic report)
native-diagnostic-dialog.test.js:
✔ keeps Default Runtime Host errors in diagnostics instead of dialog copy
    assert.doesNotMatch(JSON.stringify(recovery.options), /very-secret-token/u)
    assert.match(report, /Error: Authorization/u)
renderer-error-report.test.js:
✔ keeps raw exceptions out of the localized crash surface
ℹ tests 7  ℹ pass 7  ℹ fail 0

Workspace build, the touched suites, renderer/storybook typecheck, and Biome pass locally.

AI use

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: Claude Code implemented the migration, reviewed it for simplification (dead shell-copy group, catalog placement), and ran the listed checks.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No
@orangeCatDeveloper
orangeCatDeveloper force-pushed the fix/desktop-error-boundary branch from 7c994b9 to 2694b75 Compare September 1, 2026 10:23
@github-actions github-actions Bot added the effort/L Under 1000 readable lines label Sep 1, 2026
@orangeCatDeveloper
orangeCatDeveloper force-pushed the fix/desktop-error-boundary branch from 2694b75 to 815660d Compare September 1, 2026 10:58
Unexpected exceptions are diagnostic data, not stable product copy. Keep details in the report and console while showing localized recovery guidance.
@orangeCatDeveloper
orangeCatDeveloper force-pushed the fix/desktop-error-boundary branch from 815660d to bfe48f1 Compare September 1, 2026 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/L Under 1000 readable lines

1 participant