File tree Expand file tree Collapse file tree 1 file changed +18
-3
lines changed
stac_fastapi/core/stac_fastapi/core/extensions Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Original file line number Diff line number Diff line change 11"""Catalogs extension."""
22
3+ import logging
34from typing import List , Optional , Type
45from urllib .parse import urlparse
56
1314from stac_fastapi .types .core import BaseCoreClient
1415from stac_fastapi .types .extension import ApiExtension
1516
17+ logger = logging .getLogger (__name__ )
18+
1619
1720@attr .s
1821class CatalogsExtension (ApiExtension ):
@@ -328,9 +331,21 @@ async def get_catalog_collections(
328331 coll_id , request = request
329332 )
330333 collections .append (collection )
331- except Exception :
332- # Skip collections that can't be found
333- continue
334+ except HTTPException as e :
335+ # Only skip collections that are not found (404)
336+ if e .status_code == 404 :
337+ logger .debug (f"Collection { coll_id } not found, skipping" )
338+ continue
339+ else :
340+ # Re-raise other HTTP exceptions (5xx server errors, etc.)
341+ logger .error (f"HTTP error retrieving collection { coll_id } : { e } " )
342+ raise
343+ except Exception as e :
344+ # Log unexpected errors and re-raise them
345+ logger .error (
346+ f"Unexpected error retrieving collection { coll_id } : { e } "
347+ )
348+ raise
334349
335350 # Return in Collections format
336351 base_url = str (request .base_url )
You can’t perform that action at this time.
0 commit comments