Repository navigation
ROB: Raise a clear TypeError for an unsupported page_number in add_outline_item - #4080
Merged
stefan6419846 merged 2 commits intoSep 16, 2026
Merged
Conversation
…_item Co-Authored-By: Claude Sonnet 5 <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4080 +/- ##
==========================================
+ Coverage 98.12% 98.14% +0.02%
==========================================
Files 59 59
Lines 11490 11514 +24
Branches 2150 2149 -1
==========================================
+ Hits 11274 11300 +26
Misses 122 122
+ Partials 94 92 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
stefan6419846
requested changes
Sep 15, 2026
stefan6419846
approved these changes
Sep 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
add_outline_item's page_number branch only assigns page_ref for
IndirectObject, PageObject and int. Anything else falls through with no
assignment, so the very next line —
if page_ref is None:— raisesUnboundLocalError instead of telling the caller what was actually wrong.
Added an explicit else branch that raises TypeError naming the bad type,
matching the convention already used elsewhere in this file (e.g.
add_annotation's "page: invalid type").
Offline suite passes, 1340 tests.
Used Claude (Opus) to help locate and patch this; I reviewed and tested the change.