From 181004b16fc2538e47bed9ce78eef12a367a8acd Mon Sep 17 00:00:00 2001 From: Baudouin Raoult Date: Wed, 20 Nov 2019 14:40:06 +0000 Subject: Add error message when CDS is in maintenance mode --- cdsapi/api.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'cdsapi') diff --git a/cdsapi/api.py b/cdsapi/api.py index ed8e5bb..3af6b36 100644 --- a/cdsapi/api.py +++ b/cdsapi/api.py @@ -518,6 +518,10 @@ class Client(object): if r is not None: if not retriable(r.status_code, r.reason): return r + try: + self.warning(r.json()['reason']) + except Exception: + pass self.warning("Recovering from HTTP error [%s %s], attemps %s of %s", r.status_code, r.reason, tries, self.retry_max) -- cgit v1.2.3