File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
stac_fastapi/elasticsearch/stac_fastapi/elasticsearch Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -105,9 +105,8 @@ async def item_collection(
105105 collection = await self .get_collection (
106106 collection_id = collection_id , request = request
107107 )
108- try :
109- collection_id = collection ["id" ]
110- except Exception :
108+ collection_id = collection .get ("id" )
109+ if collection_id is None :
111110 raise HTTPException (status_code = 404 , detail = "Collection not found" )
112111
113112 search = self .database .make_search ()
@@ -313,9 +312,9 @@ async def post_search(
313312 cql2_filter = getattr (search_request , "filter" , None )
314313 try :
315314 search = self .database .apply_cql2_filter (search , cql2_filter )
316- except Exception :
315+ except Exception as e :
317316 raise HTTPException (
318- status_code = 400 , detail = "Error with cql2_json filter"
317+ status_code = 400 , detail = f "Error with cql2_json filter: { e } "
319318 )
320319
321320 sort = None
You can’t perform that action at this time.
0 commit comments