Skip to content

🐛 fix some uncaught exceptions preventing the creation of LocalInputSource#206

Merged
sebastianMindee merged 2 commits into
mainfrom
fix-exception-handling-GS-FPDF
Jul 9, 2026
Merged

🐛 fix some uncaught exceptions preventing the creation of LocalInputSource#206
sebastianMindee merged 2 commits into
mainfrom
fix-exception-handling-GS-FPDF

Conversation

@sebastianMindee

Copy link
Copy Markdown
Collaborator

Description

Addresses #205

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Requires a change to the official Guide documentation.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Fixes uncaught exceptions during LocalInputSource initialization so PDF inputs that FPDI can’t parse (e.g., unsupported compression) don’t prevent creating an input source, aligning with issue #205’s request to bypass local PDF handling failures.

Changes:

  • Add a regression test asserting pageCount becomes null when encountering an unsupported PDF (e.g., XfaForm.pdf).
  • Broaden constructor exception handling to avoid failing LocalInputSource creation when PDF parsing throws.
  • Minor formatting adjustment in compress() signature.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/Input/LocalInputSource.php Adds a broad fallback catch during construction to avoid aborting on PDF-related exceptions; minor formatting change.
tests/Input/LocalInputSourceTest.php Adds a test covering unsupported PDF parsing to ensure pageCount is null.

Comment thread src/Input/LocalInputSource.php
Comment thread src/Input/LocalInputSource.php
@sebastianMindee sebastianMindee requested a review from ianardee July 9, 2026 15:41
@sebastianMindee sebastianMindee merged commit cdc3ffb into main Jul 9, 2026
32 checks passed
@sebastianMindee sebastianMindee deleted the fix-exception-handling-GS-FPDF branch July 9, 2026 15:41
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