Skip to content

Commit

Permalink
Raise more meaningful error when allen api produces empty response body
Browse files Browse the repository at this point in the history
  • Loading branch information
AhmetNSimsek committed Oct 24, 2024
1 parent 73edcc6 commit 31b0912
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion siibra/livequeries/allen.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,10 @@ def _retrieve_microarray(cls, donor_id: str, probe_ids: str) -> Iterable[GeneExp
url = AllenBrainAtlasQuery._QUERY["microarray"].format(
probe_ids=",".join([str(id) for id in probe_ids]), donor_id=donor_id
)
response = HttpRequest(url, json.loads).get()
try:
response = HttpRequest(url, json.loads).get()
except json.JSONDecodeError as e:
raise RuntimeError(f"Allen institute site produced an empty response - please try again later.\n{e}")
if not response["success"]:
raise Exception(
"Invalid response when retrieving microarray data: {}".format(url)
Expand Down

0 comments on commit 31b0912

Please sign in to comment.