diff options
-rw-r--r-- | cdsapi/api.py | 6 | ||||
-rwxr-xr-x | example-era5.py | 2 | ||||
-rwxr-xr-x | example-glaciers.py (renamed from simple-example.py) | 0 |
3 files changed, 4 insertions, 4 deletions
diff --git a/cdsapi/api.py b/cdsapi/api.py index c8f3d58..f8517ac 100644 --- a/cdsapi/api.py +++ b/cdsapi/api.py @@ -191,12 +191,12 @@ class Client(object): continue if reply['state'] in ('failed',): - print('Message: %s' % (reply['error'].get('message'),)) - print('Reason: %s' % (reply['error'].get('reason'),)) + self.logger.error('Message: %s' % (reply['error'].get('message'),)) + self.logger.error('Reason: %s' % (reply['error'].get('reason'),)) for n in reply.get('error', {}).get('context', {}).get('traceback', '').split('\n'): if n.strip() == '' and not self.full_stack: break - print(' %s' % (n,)) + self.logger.error(' %s' % (n,)) raise Exception(reply['error'].get('reason'),) raise Exception('Unknown API state [%s]' % (reply['state'],)) diff --git a/example-era5.py b/example-era5.py index 90f3087..67cc6f2 100755 --- a/example-era5.py +++ b/example-era5.py @@ -16,7 +16,7 @@ c.retrieve("reanalysis-era5-pressure-levels", "variable": "geopotential", "pressure_level": "500", "product_type": "reanalysis", - "date": "2008-01-01/to/2017-01-01", + "date": "2008-01-01/2017-12-31", "time": "12:00", "format": "grib" }, diff --git a/simple-example.py b/example-glaciers.py index 976c8ca..976c8ca 100755 --- a/simple-example.py +++ b/example-glaciers.py |