Skip to content

Commit 5e540f2

Browse files
authored
fix: add 'requests.exceptions.ChunkedEncodingError' to retryable exceptions (googleapis#237)
Closes googleapis#235.
1 parent 3d4cab2 commit 5e540f2

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

google/api_core/retry.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ def if_exception_type_predicate(exception):
104104
exceptions.TooManyRequests,
105105
exceptions.ServiceUnavailable,
106106
requests.exceptions.ConnectionError,
107+
requests.exceptions.ChunkedEncodingError,
107108
auth_exceptions.TransportError,
108109
)
109110
"""A predicate that checks if an exception is a transient API error.

tests/unit/test_retry.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ def test_if_transient_error():
4545
assert retry.if_transient_error(exceptions.TooManyRequests(""))
4646
assert retry.if_transient_error(exceptions.ServiceUnavailable(""))
4747
assert retry.if_transient_error(requests.exceptions.ConnectionError(""))
48+
assert retry.if_transient_error(requests.exceptions.ChunkedEncodingError(""))
4849
assert retry.if_transient_error(auth_exceptions.TransportError(""))
4950
assert not retry.if_transient_error(exceptions.InvalidArgument(""))
5051

0 commit comments

Comments
 (0)