Skip to content

Commit 4abb403

Browse files
authored
fix: make 'requests.exceptions.ChunkedEncodingError retryable by default (#526)
Closes #525.
1 parent aefe198 commit 4abb403

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

google/cloud/storage/retry.py

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# limitations under the License.
1414

1515
import requests
16+
import requests.exceptions as requests_exceptions
1617

1718
from google.api_core import exceptions as api_exceptions
1819
from google.api_core import retry
@@ -33,6 +34,7 @@
3334
api_exceptions.ServiceUnavailable, # 503
3435
api_exceptions.GatewayTimeout, # 504
3536
requests.ConnectionError,
37+
requests_exceptions.ChunkedEncodingError,
3638
)
3739

3840

tests/unit/test_retry.py

+6
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ def test_w_requests_connection_error(self):
6969
exc = requests.ConnectionError()
7070
self.assertTrue(self._call_fut(exc))
7171

72+
def test_w_requests_chunked_encoding_error(self):
73+
import requests.exceptions
74+
75+
exc = requests.exceptions.ChunkedEncodingError()
76+
self.assertTrue(self._call_fut(exc))
77+
7278
def test_miss_w_stdlib_error(self):
7379
exc = ValueError("testing")
7480
self.assertFalse(self._call_fut(exc))

0 commit comments

Comments
 (0)