Skip to content

Commit fad5f1b

Browse files
Merge pull request #73 from asfadmin/dev
Dev
2 parents fc43c5c + 9479336 commit fad5f1b

1 file changed

Lines changed: 16 additions & 16 deletions

File tree

src/SearchAPI/application/application.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -268,22 +268,22 @@ def validate_wkt(wkt: str):
268268
}
269269

270270
def _get_aria_baseline_stack(reference: str, opts: asf.ASFSearchOptions, output: str):
271-
if output.lower() == 'count':
272-
stack_opts = asf.Products.ARIAS1GUNWProduct.get_stack_opts_for_frame(int(reference), opts=opts)
273-
count=asf.search_count(opts=stack_opts)
274-
return Response(
275-
content=str(count),
276-
status_code=200,
277-
media_type='text/html; charset=utf-8',
278-
headers=constants.DEFAULT_HEADERS
279-
)
280-
try:
281-
stack = asf.stack_from_id(reference, opts=opts)
282-
response_info = as_output(stack, output)
283-
return Response(**response_info)
284-
except (KeyError, IndexError, ValueError) as exc:
285-
raise HTTPException(detail=f"Reference scene not found with frame: {reference}", status_code=400) from exc
286-
271+
if output.lower() == 'count':
272+
stack_opts = asf.Products.ARIAS1GUNWProduct.get_stack_opts_for_frame(int(reference), opts=opts)
273+
count=asf.search_count(opts=stack_opts)
274+
return Response(
275+
content=str(count),
276+
status_code=200,
277+
media_type='text/html; charset=utf-8',
278+
headers=constants.DEFAULT_HEADERS
279+
)
280+
try:
281+
stack = asf.stack_from_id(reference, opts=opts)
282+
response_info = as_output(stack, output)
283+
return Response(**response_info)
284+
except (KeyError, IndexError, ValueError) as exc:
285+
raise HTTPException(detail=f"Ran into an issue building stack for frame: {reference}\nException: {str(exc)}", status_code=400) from exc
286+
287287

288288
@router.get('/', response_class=JSONResponse)
289289
@router.get('/health', response_class=JSONResponse)

0 commit comments

Comments
 (0)