Skip to content

Commit

Permalink
adds error handling when provided invalid dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
kim committed Nov 6, 2023
1 parent 732048b commit d00fb34
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions SearchAPI/CMR/Translate/input_fixer.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,11 @@ def input_fixer(params, is_prod: bool = False, provider: str = "ASF"):
elif k == 'datasets':
fixed_params['collections'] = []
for dataset in params[k]:
logging.warn(dataset)
logging.warn(platform_datasets.get(dataset))
fixed_params['collections'].extend(platform_datasets.get(dataset))
if platform_datasets.get(dataset):
fixed_params['collections'].extend(platform_datasets.get(dataset))
else:
raise ValueError(f'Could not find dataset named "{dataset}" provided for datasets keyword.')

logging.warn(fixed_params)
elif k == 'beammode':
beammap = {
Expand Down

0 comments on commit d00fb34

Please sign in to comment.