Skip to content

fix(report): answer a PDF print timeout with 413 and an explanation - #97

Merged
buzz-code merged 1 commit into
mainfrom
claude/pdf-print-timeout-413
Nov 8, 2026
Merged

buzz-code merged 1 commit into
mainfrom
claude/pdf-print-timeout-413

Conversation

@buzz-code

Copy link
Copy Markdown
Owner

What

When Page.printToPDF timed out (a very large export, e.g. a pivot report with limit=20000), the raw puppeteer error escaped and the request ended as a bare 500.

Change

  • MarkupToPdfReportGenerator wraps the print timeout in a new PdfPrintTimeoutError (code PDF_PRINT_TIMEOUT). It is not retried, since a retry cannot make the report smaller.
  • AllExceptionsFilter replies 413 with that code and a message asking to narrow the filter (e.g. a shorter date range) or export to Excel. It is logged as a warning.
  • The existing 503 "render queue busy" path is untouched.

Tests

yarn jest utils/report utils/logging: new cases for the generator (wraps, no retry, browser closed) and for the filter (413 body, no response.err).

No consumer action needed after a submodule bump; clients can map code to a localized message if they want.


Generated by Claude Code

Page.printToPDF timing out (a very large export) escaped as the raw puppeteer
error and became a bare 500. It is now wrapped in PdfPrintTimeoutError, not
retried (a retry cannot make the report smaller), and AllExceptionsFilter replies
413 with code PDF_PRINT_TIMEOUT and a message asking to narrow the filter or
export to Excel.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012GTicqgTde92c75hERgg3v
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.

2 participants