From bd49015c8c4dca97added470930216c34ec2841d Mon Sep 17 00:00:00 2001 From: Gordon Woodhull Date: Mon, 26 Jan 2026 14:55:27 -0500 Subject: [PATCH 1/2] claude: Support array of printsMessage checks in smoke tests Allows testing for both presence AND absence of specific messages in a single test by passing an array to printsMessage. Co-Authored-By: Claude Opus 4.5 --- tests/smoke/smoke-all.test.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/smoke/smoke-all.test.ts b/tests/smoke/smoke-all.test.ts index b209c2a631..9b85314d23 100644 --- a/tests/smoke/smoke-all.test.ts +++ b/tests/smoke/smoke-all.test.ts @@ -263,7 +263,11 @@ function resolveTestSpecs( verifyFns.push(verifyMap[key](outputFile.outputPath, ...value)); } } else if (key === "printsMessage") { - verifyFns.push(verifyMap[key](value)); + // Support both single object and array of printsMessage checks + const messages = Array.isArray(value) ? value : [value]; + for (const msg of messages) { + verifyFns.push(verifyMap[key](msg)); + } } else if (key === "ensureEpubFileRegexMatches") { // this ensure function is special because it takes an array of path + regex specifiers, // so we should never use the spread operator From df9c4373fe55147dec73b7dc4e4afb91186fe3dd Mon Sep 17 00:00:00 2001 From: Gordon Woodhull Date: Mon, 26 Jan 2026 14:56:13 -0500 Subject: [PATCH 2/2] 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 --- news/changelog-1.9.md | 1 + src/command/render/output-typst.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/news/changelog-1.9.md b/news/changelog-1.9.md index 1a6e122281..886e181b4c 100644 --- a/news/changelog-1.9.md +++ b/news/changelog-1.9.md @@ -53,6 +53,7 @@ All changes included in 1.9: - Two-column layout now uses `set page(columns:)` instead of `columns()` function, fixing compatibility with landscape sections. - Title block now properly spans both columns in multi-column layouts. - ([#13870](https://github.com/quarto-dev/quarto-cli/issues/13870)): Add support for `alt` attribute on cross-referenced equations for improved accessibility. (author: @mcanouil) +- ([#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. ### `pdf` diff --git a/src/command/render/output-typst.ts b/src/command/render/output-typst.ts index 695a144a8f..58352b8212 100644 --- a/src/command/render/output-typst.ts +++ b/src/command/render/output-typst.ts @@ -27,6 +27,7 @@ import { kVariant, } from "../../config/constants.ts"; import { error, warning } from "../../deno_ral/log.ts"; +import { ErrorEx } from "../../core/lib/error.ts"; import { Format } from "../../config/types.ts"; import { writeFileToStdout } from "../../core/console.ts"; import { dirAndStem, expandPath } from "../../core/path.ts"; @@ -161,11 +162,10 @@ export function typstPdfOutputRecipe( typstOptions, ); if (!result.success) { - // Log the error so test framework can detect it via shouldError if (result.stderr) { error(result.stderr); } - throw new Error("Typst compilation failed"); + throw new ErrorEx("Error", "Typst compilation failed", false, false); } // Validate PDF against specified standards using verapdf (if available)