Skip to content

Throw IOException from writeHTML() when the file cannot be written - #100

Merged
jakejackson1 merged 1 commit into
mainfrom
fix/issue-92
Oct 25, 2026
Merged

jakejackson1 merged 1 commit into
mainfrom
fix/issue-92

Conversation

@gravitypdf-bot

Copy link
Copy Markdown
Contributor

Fixes #92

writeHTML() installed ParseException's error handler, so a failed write threw ParseException rather than IOException as writeXML() and writeHTML5() do. IOException extends ParseException, so existing catch (ParseException $e) blocks still catch it.

Tests: testFailWriteHTML() called writeXML(), so writeHTML()'s failure path was untested. It now calls writeHTML() and fails on main. I also removed the rethrow-only try/catch wrappers from it and from testFailWriteXML() and testFailWriteXHTML(), since expectException() already does that job.

This and #95 both change the line in writeHTML() that installs the error handler, so whichever merges second needs a one-line rebase.

🤖 Generated with Claude Code

@gravitypdf-bot gravitypdf-bot changed the title writeHTML() throws ParseException instead of IOException when the file cannot be written Throw IOException from writeHTML() when the file cannot be written Oct 25, 2026
@codecov

codecov Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.55%. Comparing base (ee074dc) to head (c05cdac).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main     #100   +/-   ##
=========================================
  Coverage     90.55%   90.55%           
  Complexity     1425     1425           
=========================================
  Files            25       25           
  Lines          3166     3166           
=========================================
  Hits           2867     2867           
  Misses          299      299           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

writeHTML() installed ParseException's error handler where the other
writers install IOException's. testFailWriteHTML() called writeXML(), so
the failure path went untested; it now calls writeHTML().

Fixes #92

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jakejackson1
jakejackson1 merged commit 82977f2 into main Oct 25, 2026
14 checks passed
@jakejackson1
jakejackson1 deleted the fix/issue-92 branch October 25, 2026 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

writeHTML() throws ParseException instead of IOException when the file cannot be written

2 participants