fix(session): name the API error code and the short rnet cause of an exhausted request

This commit is contained in:
imSp4rky
2026-12-05 01:28:38 -07:00
parent cd6046bf82
commit 641623590d
6 changed files with 192 additions and 15 deletions
+5
View File
@@ -185,6 +185,11 @@ def test_a_bad_content_encoding_is_no_network_error() -> None:
assert categorize_exception(rnet_error(BAD_DEFLATE)).error_code != APIErrorCode.NETWORK_ERROR
def test_a_bare_rnet_error_reads_as_its_short_cause() -> None:
err = categorize_exception(rnet_error(SHORT_BODY))
assert err.message == "Network error occurred: DecodingError (IncompleteBody)"
def test_categorize_preserves_context() -> None:
api_err = categorize_exception(ValueError("bad"), context={"op": "search"})
assert api_err.details["op"] == "search"