From 5b5d69d69541c356408518e2e3f30e34fb6177cf Mon Sep 17 00:00:00 2001 From: Harald NordgÄrd-Hansen Date: Sun, 30 Jun 2019 18:49:37 +0200 Subject: Protect against ReadTimeout errors sometimes returned by requests. --- cdsapi/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- cgit v1.2.3