File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 1414from typing import Any
1515
1616import requests
17+ from fastapi import HTTPException
1718from pydantic import ValidationError
1819
1920from dcd_mapping .resource_utils import (
@@ -283,8 +284,17 @@ async def wrapper(*args, **kwargs) -> ScoresetMapping: # noqa: ANN002
283284 # Set up metadata and scores for the current run. Now they will be accessible by these functions
284285 # without the need to download the data again.
285286 temp_dir_as_path = Path (temp_dir )
286- get_scoreset_metadata (urn , temp_dir_as_path )
287- get_scoreset_records (urn , silent , temp_dir_as_path )
287+ try :
288+ get_scoreset_metadata (urn , temp_dir_as_path )
289+ get_scoreset_records (urn , silent , temp_dir_as_path )
290+ except ScoresetNotSupportedError as e :
291+ return ScoresetMapping (
292+ metadata = None ,
293+ error_message = str (e ).strip ("'" ),
294+ )
295+ except ResourceAcquisitionError as e :
296+ msg = f"Unable to acquire resource from MaveDB: { e } "
297+ raise HTTPException (status_code = 500 , detail = msg ) from e
288298
289299 # Pass the storage path of the temp directory to the wrapped function as a kwarg.
290300 kwargs ["store_path" ] = temp_dir_as_path
You can’t perform that action at this time.
0 commit comments