Skip to content

Commit

Permalink
Merge branch 'release_23.2' into release_24.0
Browse files Browse the repository at this point in the history
  • Loading branch information
nsoranzo committed Jul 8, 2024
2 parents b183c55 + 1b0b82f commit 9a658ae
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/galaxy/tool_util/biotools/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,13 @@ def __init__(self, cache=None):

def _raw_get_metadata(self, biotools_reference) -> Optional[str]:
api_url = f"https://bio.tools/api/tool/{biotools_reference}?format=json"
req = requests.get(api_url, timeout=DEFAULT_SOCKET_TIMEOUT)
req.encoding = req.apparent_encoding
if req.status_code == 404:
return None
else:
try:
req = requests.get(api_url, timeout=DEFAULT_SOCKET_TIMEOUT)
req.raise_for_status()
req.encoding = req.apparent_encoding
return req.text
except Exception:
return None

def get_biotools_metadata(self, biotools_reference: str) -> Optional[BiotoolsEntry]:
createfunc = functools.partial(self._raw_get_metadata, biotools_reference)
Expand Down

0 comments on commit 9a658ae

Please sign in to comment.