Skip to content

Commit 40d3190

Browse files
lesnik512claude
andcommitted
docs(story-1.8): RecordedTransport docstring notes BaseException rationale
Final review concern: the docstring named the route/default type (`Response | BaseException`) without explaining why BaseException (not Exception) is the chosen union. Adds a one-paragraph note: the choice lets test code express `asyncio.CancelledError`, `SystemExit`, etc.; surfaces that these bypass `except Exception:`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 40781d8 commit 40d3190

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/httpware/transports/recorded.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ class RecordedTransport:
2525
swap the route between calls via `add_route(...)` or construct a new
2626
transport per call.
2727
28+
Route and default values may be `BaseException` (not just `Exception`) so
29+
test code can express `asyncio.CancelledError`, `SystemExit`, or
30+
`KeyboardInterrupt` — useful for cancellation/shutdown propagation tests.
31+
These do NOT get caught by user code's `except Exception:`.
32+
2833
`stream()` raises NotImplementedError; streaming lands in Epic 4 (Story 4-1).
2934
"""
3035

0 commit comments

Comments
 (0)