Skip to content

Commit

Permalink
fix(server): raise search errors for a given provider
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunato committed Jan 19, 2024
1 parent 112855c commit dadfa42
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion eodag/rest/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,9 @@ def search_products(
else:
criterias.update(arguments)

if provider:
criterias["raise_errors"] = True

# We remove potential None values to use the default values of the search method
criterias = dict((k, v) for k, v in criterias.items() if v is not None)

Expand Down Expand Up @@ -565,6 +568,8 @@ def search_product_by_id(
:raises: :class:`~eodag.utils.exceptions.ValidationError`
:raises: RuntimeError
"""
if provider:
kwargs["raise_errors"] = True
try:
products, _ = eodag_api.search(
id=uid, productType=product_type, provider=provider, **kwargs
Expand Down Expand Up @@ -676,7 +681,7 @@ def get_stac_item_by_id(
_dc_qs = kwargs.get("_dc_qs", None)

found_products = search_product_by_id(
item_id, product_type=product_type, _dc_qs=_dc_qs
item_id, product_type=product_type, provider=provider, _dc_qs=_dc_qs
)

if len(found_products) > 0:
Expand Down

0 comments on commit dadfa42

Please sign in to comment.