Skip to content

Fix stack trace shown for Typst compilation errors#13957

Merged
gordonwoodhull merged 2 commits intomainfrom
bugfix/13942
Feb 17, 2026
Merged

Fix stack trace shown for Typst compilation errors#13957
gordonwoodhull merged 2 commits intomainfrom
bugfix/13942

Conversation

@gordonwoodhull
Copy link
Copy Markdown
Member

Summary

  • When Typst compilation fails (e.g., PDF/UA compliance errors), show only the Typst error message without a confusing internal stack trace
  • Uses ErrorEx with printStack=false for clean user-facing errors
  • Also adds support for array of printsMessage checks in smoke tests (enabling tests for both presence AND absence of messages)

Fixes #13942

Test plan

  • Tested in production build - error output now shows:
    ERROR: error: PDF/UA-1 error: missing alt text
        ...
    ERROR: Typst compilation failed
    
    Without the stack trace that was previously shown.

🤖 Generated with Claude Code

@posit-snyk-bot
Copy link
Copy Markdown
Collaborator

posit-snyk-bot commented Jan 26, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

gordonwoodhull and others added 2 commits February 17, 2026 15:38
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 <noreply@anthropic.com>
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>
@gordonwoodhull gordonwoodhull merged commit 45e1471 into main Feb 17, 2026
51 checks passed
@gordonwoodhull gordonwoodhull deleted the bugfix/13942 branch February 17, 2026 21:19
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, as there is no test associated with this change. What is the syntax that is enabled by this change?

Thanks

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This suppresses the stack trace when showing a Typst failure in a production (packaged) build.

It can’t be tested because we don’t currently do any significant testing of production builds, and the technique only works in production.

(As developers we’re used to stack traces, but at least in theory we shouldn’t be showing them for expected/known failures in prod. I don’t think we’re very good at this.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pdf-standard leads to stacktrace

4 participants