forked from kenzuya/unshackle
fix(session): name the API error code and the short rnet cause of an exhausted request
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user