diff options
author | Harald Nordgård-Hansen <hnh@wattsight.com> | 2019-06-30 18:49:37 +0200 |
---|---|---|
committer | Harald Nordgård-Hansen <hnh@wattsight.com> | 2019-06-30 18:49:37 +0200 |
commit | 5b5d69d69541c356408518e2e3f30e34fb6177cf (patch) | |
tree | 5fd7e73fb6d1375a4b87284f7135b022239b0b93 | |
parent | 9af2dabc01e47552c19c581df66cd6698715b99a (diff) |
Protect against ReadTimeout errors sometimes returned by requests.
-rw-r--r-- | cdsapi/api.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cdsapi/api.py b/cdsapi/api.py index 88a3a8c..be30d8b 100644 --- a/cdsapi/api.py +++ b/cdsapi/api.py @@ -360,7 +360,7 @@ class Client(object): while tries < self.retry_max: try: r = call(*args, **kwargs) - except requests.exceptions.ConnectionError as e: + except (requests.exceptions.ConnectionError, requests.exceptions.ReadTimeout) as e: r = None self.warning("Recovering from connection error [%s], attemps %s of %s", e, tries, self.retry_max) |