-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Summary
DOCX conversion failures from Typst compilation are currently hard to debug because the surfaced error is too generic.
Problem
When Typst compilation fails, the current error path does not provide enough context (exact line/column, local source snippet, and stable stage attribution). This increases turnaround time for parser/codegen fixes.
Proposal
- Extend PDF rendering error propagation to include:
- stage (
typst_codegenvstypst_compile) - line/column (when available)
- primary diagnostic message
- short source snippet around the failing location
- Add opt-in debug artifact dumping:
- library option:
ConversionOptions::dump_typst_on_error: Option<PathBuf> - CLI option:
--dump-typst-on-error <dir> - default behavior remains safe (no persistent dump unless explicitly enabled)
- Make diagnostics machine-readable for tests:
- add structured error fields rather than only a flattened string
Code Areas
crates/office2pdf/src/render/pdf.rscrates/office2pdf/src/error.rscrates/office2pdf-cli/src/main.rs
Acceptance Criteria
- A forced Typst compile failure reports line/column and stage.
- Error output includes a compact snippet with pointer to failing token.
- With
--dump-typst-on-error, generated Typst source is written to disk and path is printed. - New tests cover both default and debug-dump modes.
Non-Goals
- No change to document layout behavior in this issue.
- No fixture content from private/internal corpora is embedded in tests or logs.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working