Skip to content

Commit 31b0912

Browse files
committed
Raise more meaningful error when allen api produces empty response body
1 parent 73edcc6 commit 31b0912

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

siibra/livequeries/allen.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,10 @@ def _retrieve_microarray(cls, donor_id: str, probe_ids: str) -> Iterable[GeneExp
292292
url = AllenBrainAtlasQuery._QUERY["microarray"].format(
293293
probe_ids=",".join([str(id) for id in probe_ids]), donor_id=donor_id
294294
)
295-
response = HttpRequest(url, json.loads).get()
295+
try:
296+
response = HttpRequest(url, json.loads).get()
297+
except json.JSONDecodeError as e:
298+
raise RuntimeError(f"Allen institute site produced an empty response - please try again later.\n{e}")
296299
if not response["success"]:
297300
raise Exception(
298301
"Invalid response when retrieving microarray data: {}".format(url)

0 commit comments

Comments
 (0)