Skip to content

Commit

Permalink
[builder] Add ClientResponseError to the builder managed exceptions (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ebezzi committed May 24, 2024
1 parent 9f7128a commit 36d98e8
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ def _read_a_block(filelike: OpenFile, blk_off: int, blk_len: int) -> tuple[int,
# read block into memory
with copy.copy(filelike) as f:
sleep_for_secs = 3
last_error: aiohttp.ClientPayloadError | None = None
last_error: aiohttp.ClientPayloadError | aiohttp.ClientResponseError | None = None
for attempt in range(4):
try:
return (blk_off, read_block(f, blk_off, blk_len))
except (aiohttp.ClientPayloadError, ConnectionError) as e:
except (aiohttp.ClientPayloadError, aiohttp.ClientResponseError, ConnectionError) as e:
logger.error(f"Fetch of {from_url} failed: {str(e)}")
last_error = e
time.sleep(2**attempt * sleep_for_secs)
Expand Down

0 comments on commit 36d98e8

Please sign in to comment.