Skip to content

Commit a3eb368

Browse files
committed
Add TimeoutError
1 parent 9d3bbe1 commit a3eb368

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

tutorials/spherex/spherex_cutouts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ def process_cutout_with_error_handling(row, ra, dec, cache):
212212
'''
213213
try:
214214
process_cutout(row, ra, dec, cache=cache)
215-
except (urllib.error.HTTPError, http.client.IncompleteRead):
215+
except (TimeoutError, urllib.error.HTTPError, http.client.IncompleteRead):
216216
# Transient read errors. Skip this cutout.
217217
row["hdus"] = None
218218
```

tutorials/spherex/spherex_intro.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ for attempt in range(max_retries):
167167
# Load the data.
168168
hdulist = fits.open(spectral_image_url)
169169
break
170-
except (urllib.error.HTTPError, http.client.IncompleteRead):
170+
except (TimeoutError, urllib.error.HTTPError, http.client.IncompleteRead):
171171
if attempt == max_retries - 1:
172172
raise
173173
time.sleep(10 * (attempt + 1))

tutorials/spherex/spherex_psf.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ for attempt in range(max_retries):
153153
cutout = hdul['IMAGE'].data
154154
psfcube = hdul['PSF'].data
155155
break
156-
except (urllib.error.HTTPError, http.client.IncompleteRead):
156+
except (TimeoutError, urllib.error.HTTPError, http.client.IncompleteRead):
157157
if attempt == max_retries - 1:
158158
raise
159159
time.sleep(10 * (attempt + 1))

0 commit comments

Comments
 (0)