Skip to content

Commit 612621d

Browse files
claude: Fix stack trace shown for Typst compilation errors
Use ErrorEx with printStack=false so users see only the Typst error message without a confusing internal stack trace. Fixes #13942 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent f6333b6 commit 612621d

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

news/changelog-1.9.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ All changes included in 1.9:
6868
- Two-column layout now uses `set page(columns:)` instead of `columns()` function, fixing compatibility with landscape sections.
6969
- Title block now properly spans both columns in multi-column layouts.
7070
- ([#13870](https://github.com/quarto-dev/quarto-cli/issues/13870)): Add support for `alt` attribute on cross-referenced equations for improved accessibility. (author: @mcanouil)
71+
- ([#13942](https://github.com/quarto-dev/quarto-cli/issues/13942)): Fix Typst compilation errors showing confusing internal stack traces. Users now see only the relevant Typst error message.
7172
- ([#13950](https://github.com/quarto-dev/quarto-cli/pull/13950)): Replace ctheorems with theorion package for theorem environments. Add `theorem-appearance` option to control styling: `simple` (default, classic LaTeX style), `fancy` (colored boxes with brand colors), `clouds` (rounded backgrounds), or `rainbow` (colored start border and colored title).
7273
- ([#13954](https://github.com/quarto-dev/quarto-cli/issues/13954)): Add support for Typst book projects via format extensions. Quarto now bundles the `orange-book` extension which provides a textbook-style format with chapter numbering, cross-references, and professional styling. Book projects with `format: typst` automatically use this extension.
7374
- ([#13978](https://github.com/quarto-dev/quarto-cli/pull/13978)): Keep term and description together in definition lists to avoid breaking across pages. (author: @mcanouil)

src/command/render/output-typst.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import {
2929
kVariant,
3030
} from "../../config/constants.ts";
3131
import { error, warning } from "../../deno_ral/log.ts";
32+
import { ErrorEx } from "../../core/lib/error.ts";
3233
import { Format } from "../../config/types.ts";
3334
import { writeFileToStdout } from "../../core/console.ts";
3435
import { dirAndStem, expandPath } from "../../core/path.ts";
@@ -167,11 +168,10 @@ export function typstPdfOutputRecipe(
167168
typstOptions,
168169
);
169170
if (!result.success) {
170-
// Log the error so test framework can detect it via shouldError
171171
if (result.stderr) {
172172
error(result.stderr);
173173
}
174-
throw new Error("Typst compilation failed");
174+
throw new ErrorEx("Error", "Typst compilation failed", false, false);
175175
}
176176

177177
// Validate PDF against specified standards using verapdf (if available)

0 commit comments

Comments
 (0)