Skip to content

Commit 4b7974d

Browse files
Narrow torn-marker test from bare Exception to DecodeError
The ``decode_row_header`` torn-marker pin previously caught bare ``Exception`` and treated any failure as "decode error is fine". A refactor that introduced a ``RuntimeError`` from the path that should still distinguish DONE-vs-data would slip through silently. Tighten the catch to ``DecodeError`` (the documented outcome) so a non-decode failure mode propagates and surfaces the regression. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 4b7bf7d commit 4b7974d

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

tests/test_decode_row_header_docstring.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
from __future__ import annotations
1313

14+
from dqlitewire.exceptions import DecodeError
1415
from dqlitewire.tuples import decode_row_header
1516

1617

@@ -44,9 +45,13 @@ def test_decode_row_header_torn_marker_rejected_not_silently_consumed() -> None:
4445
# Either way, the function MUST NOT return RowMarker.DONE.
4546
try:
4647
result = decode_row_header(torn, column_count=1)
47-
except Exception:
48-
# Decode error is fine — what matters is we didn't silently
49-
# eat the bytes as a DONE marker.
48+
except DecodeError:
49+
# DecodeError is the documented outcome for an underspecified
50+
# input that doesn't form a valid type-header tuple. Narrowing
51+
# the catch from bare ``Exception`` ensures a refactor-introduced
52+
# ``RuntimeError`` (or any non-decode failure mode) propagates
53+
# to surface the bug, instead of being silently absorbed as
54+
# if it were "decode error is fine here".
5055
return
5156
types_or_marker, _ = result
5257
from dqlitewire.tuples import RowMarker

0 commit comments

Comments
 (0)