Navigation Menu

Skip to content

Commit

Permalink
fix: add 'requests.exceptions.ChunkedEncodingError' to retryable exce…
Browse files Browse the repository at this point in the history
…ptions (#237)

Closes #235.
  • Loading branch information
tseaver committed Jul 23, 2021
1 parent 3d4cab2 commit 5e540f2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions google/api_core/retry.py
Expand Up @@ -104,6 +104,7 @@ def if_exception_type_predicate(exception):
exceptions.TooManyRequests,
exceptions.ServiceUnavailable,
requests.exceptions.ConnectionError,
requests.exceptions.ChunkedEncodingError,
auth_exceptions.TransportError,
)
"""A predicate that checks if an exception is a transient API error.
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_retry.py
Expand Up @@ -45,6 +45,7 @@ def test_if_transient_error():
assert retry.if_transient_error(exceptions.TooManyRequests(""))
assert retry.if_transient_error(exceptions.ServiceUnavailable(""))
assert retry.if_transient_error(requests.exceptions.ConnectionError(""))
assert retry.if_transient_error(requests.exceptions.ChunkedEncodingError(""))
assert retry.if_transient_error(auth_exceptions.TransportError(""))
assert not retry.if_transient_error(exceptions.InvalidArgument(""))

Expand Down

0 comments on commit 5e540f2

Please sign in to comment.