Skip to content

Commit ac4a629

Browse files
committed
BUG: add handling case when no results returned but a new error message
1 parent cf5a896 commit ac4a629

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

astroquery/ipac/irsa/most.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,11 @@ def _parse_full_regular_response(self, response, withTarballs=False):
189189
html = BeautifulSoup(response.content, "html5lib")
190190
download_tags = html.find_all("a", string=re.compile(".*Download.*"))
191191

192+
# If for some reason this wasn't a full response with downloadable tags,
193+
# raise an explicit exception:
194+
if not download_tags:
195+
raise ValueError('Something has gone wrong, there are no results parsed. '
196+
f'For full response see: {response.text}')
192197
# this is "Download Results Table (above)"
193198
results_response = self._request("GET", download_tags[0]["href"])
194199
retdict["results"] = Table.read(results_response.text, format="ipac")

0 commit comments

Comments
 (0)