Unverified Commit 4f3e93cf authored by Julien Chaumond's avatar Julien Chaumond Committed by GitHub
Browse files

[file_utils] do not gobble certain kinds of requests.ConnectionError (#10235)



* do not gobble certain kinds of requests.ConnectionError

* Apply review comments
Co-authored-by: default avatarLysandre <lysandre.debut@reseau.eseo.fr>
parent ce9724e1
File mode changed from 100644 to 100755
...@@ -1312,8 +1312,12 @@ def get_from_cache( ...@@ -1312,8 +1312,12 @@ def get_from_cache(
# between the HEAD and the GET (unlikely, but hey). # between the HEAD and the GET (unlikely, but hey).
if 300 <= r.status_code <= 399: if 300 <= r.status_code <= 399:
url_to_download = r.headers["Location"] url_to_download = r.headers["Location"]
except (requests.exceptions.SSLError, requests.exceptions.ProxyError):
# Actually raise for those subclasses of ConnectionError
raise
except (requests.exceptions.ConnectionError, requests.exceptions.Timeout): except (requests.exceptions.ConnectionError, requests.exceptions.Timeout):
# etag is already None # Otherwise, our Internet connection is down.
# etag is None
pass pass
filename = url_to_filename(url, etag) filename = url_to_filename(url, etag)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment