mirror of
https://github.com/fancive/obsidian-parallel-reader.git
synced 2026-07-22 17:20:24 +00:00
Replaces the single long-Notice failure UX with a kind-aware dispatcher
so users get actionable buttons instead of a wall of text.
- CliProcessError extends Error with a typed CliErrorDetails payload
(reason / pid / elapsed / idle / bytes / tails / exitCode / signal /
timeoutMs / idleTimeoutMs). All five runCli failure paths now throw
the typed error; message format is preserved so existing classifier
regex and tests still match.
- classifyGenerationError short-circuits on details.reason for the
deterministic cases (wall/idle-timeout → timeout, spawn/startup →
config, streams-unavailable → unknown). exit-nonzero falls through
so stderr-derived auth/rate-limit hints still classify correctly.
Duck-typed check avoids cli ↔ generation-job-manager circular import.
- New error-ui.ts dispatches by ErrorKind:
timeout (with details) → TimeoutDiagnosticsModal showing cmd, pid,
elapsed, idle, bytes, redacted stderr/stdout tail, plus copy /
open-settings / close buttons.
timeout (no details, e.g. API streaming) → actionable Notice.
auth/config → Notice + "Open Settings" CTA.
rate-limit → Notice + "Copy details".
schema → Notice + "Copy raw output" CTA.
unknown → unchanged legacy short Notice.
- main.ts handleGenerationError delegates to dispatcher; new
openPluginSettings() helper uses Obsidian's app.setting.openTabById.
- 21 i18n strings (zh + en) for all new UI labels and the modal copy.
- styles.css adds error notice + diagnostics modal styling.
- 7 new test assertions cover typed details on every failure path and
classifyGenerationError respecting structured reasons.
Change-Id: I8af46d375d92ba26d14180ffbeb6c3a6dedd89f5
|
||
|---|---|---|
| .. | ||
| anchor.test.js | ||
| architecture.test.js | ||
| cache.test.js | ||
| cards-nav.test.js | ||
| catalog.json | ||
| cli.test.js | ||
| direct-batch.test.js | ||
| direct-cache.test.js | ||
| direct-generation.test.js | ||
| direct-i18n.test.js | ||
| direct-markdown.test.js | ||
| direct-prompt.test.js | ||
| direct-providers.test.js | ||
| direct-settings-extra.test.js | ||
| direct-settings.test.js | ||
| direct-streaming.test.js | ||
| direct-test-setup.js | ||
| generation-job-manager.test.js | ||
| i18n.test.js | ||
| markdown.test.js | ||
| obsidian-mock.js | ||
| plugin-batch.test.js | ||
| providers.test.js | ||
| schema.test.js | ||
| scroll.test.js | ||
| settings.test.js | ||
| streaming.test.js | ||
| test-exports.test.js | ||
| test-setup.js | ||
| vault-batch.test.js | ||
| view-render.test.js | ||