diff --git a/gis/gccview/gcc_puller_functions.py b/gis/gccview/gcc_puller_functions.py index eafc84d29..17495ab03 100644 --- a/gis/gccview/gcc_puller_functions.py +++ b/gis/gccview/gcc_puller_functions.py @@ -345,9 +345,17 @@ def get_data(mapserver, layer_id, max_number = None, record_max = None): except requests.exceptions.RequestException as err: LOGGER.error("Error: %s", err) else: + if r.status_code != 200: + LOGGER.error("Query was not successful. Response: %s", r) return_json = r.json() break + keys = ['fields', 'features', 'geometryType'] + for k in keys: + if not(k in return_json.keys()): + LOGGER.error("return_json: %s", return_json) + raise KeyError(f"Return json missing field: {k}") + return return_json def find_limit(return_json):