返回 DeepSeek-Reasonix
ERROR_PRESENTATION.md
根目录 / docs / ERROR_PRESENTATION.md
1 # User-visible errors
2
3 Desktop errors use the shared `ErrorMessage` component and `presentError`
4 classifier. Summaries follow the selected English, Simplified Chinese or
5 Traditional Chinese UI language. An explicit language preference takes priority;
6 automatic mode follows the system language. The UI language is independent of
7 the language used by the backend or model.
8
9 - Classify known errors using stable codes and explicitly labelled HTTP statuses
10 before narrow legacy text matches. Give unknown failures a neutral summary.
11 - In English mode, an unclassified Chinese exception gets an English fallback;
12 the Chinese original remains available in details.
13 - Render original diagnostics as escaped, selectable text in expandable details.
14 Inspecting toast details stops automatic dismissal; manual dismissal remains available.
15 - Preserve original exceptions and codes for control flow, persistence and model
16 input. Never make recovery or permission decisions from translated text.
17 - File contents, terminal output and model-generated content are not application
18 error copy and remain unchanged.
19 - Provider failures return without automatic transport retries. A user resend is
20 a new request. Readers for historical recovery records remain supported.
21
22 New error surfaces should reuse the shared component. Existing dedicated error
23 panels may reuse the classifier while keeping their diagnostic detail view.
24 Known business errors should supply stable codes and localized messages.
25
26 `desktop/frontend/src/__tests__/error-presentation.test.tsx` covers classification,
27 all three languages, unchanged exceptions, escaping, live language switching and
28 toast lifetime. The development fixture at `/bench/error-presentation.html`
29 supports real-browser interaction and layout checks.
30
31 See [the Chinese version](ERROR_PRESENTATION.zh-CN.md).
32
32 lines MARKDOWN