Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions google/cloud/storage/retry.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

import requests
import requests.exceptions as requests_exceptions

from google.api_core import exceptions as api_exceptions
from google.api_core import retry
Expand All @@ -33,6 +34,7 @@
api_exceptions.ServiceUnavailable, # 503
api_exceptions.GatewayTimeout, # 504
requests.ConnectionError,
requests_exceptions.ChunkedEncodingError,
)


Expand Down
6 changes: 6 additions & 0 deletions tests/unit/test_retry.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ def test_w_requests_connection_error(self):
exc = requests.ConnectionError()
self.assertTrue(self._call_fut(exc))

def test_w_requests_chunked_encoding_error(self):
import requests.exceptions

exc = requests.exceptions.ChunkedEncodingError()
self.assertTrue(self._call_fut(exc))

def test_miss_w_stdlib_error(self):
exc = ValueError("testing")
self.assertFalse(self._call_fut(exc))
Expand Down