[#24] Capture error when we get a wrong API response
This commit is contained in:
parent
edd61f3a5b
commit
e2a3341777
|
@ -137,6 +137,8 @@ def load(pycsw_config, ckan_url):
|
|||
|
||||
response = requests.get(url)
|
||||
listing = response.json()
|
||||
if not isinstance(listing, dict):
|
||||
raise RuntimeError, 'Wrong API response: %s' % listing
|
||||
results = listing.get('results')
|
||||
if not results:
|
||||
break
|
||||
|
|
Loading…
Reference in New Issue