Skip to content

Commit

Permalink
add exception handling if collection is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
sebhahn committed Dec 11, 2023
1 parent f6bbb20 commit 324a46d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/ascat/download/connectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,11 @@ def download(self, product, local_path, start_date, end_date,
dataset_parameters['si'] = 0
items_per_page = 10

if "type" in found_data_sets:
if found_data_sets["type"] == "ExceptionReport":
msg = found_data_sets["exceptions"][0]["exceptionText"]
raise RuntimeError(msg)

all_found_data_sets = []
while dataset_parameters['si'] < found_data_sets['totalResults']:
response = requests.get(url, dataset_parameters)
Expand Down

0 comments on commit 324a46d

Please sign in to comment.