Skip to content

Commit 310967b

Browse files
authored
Merge pull request #3284 from bsipocz/MAINT_raise_for_status
MAINT: raise more errors earlier
2 parents d05a071 + f8d5bfc commit 310967b

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

CHANGES.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ query.py
3232
Some corner cases where downloads were not properly continued have been
3333
fixed. [#3232]
3434

35+
utils
36+
^^^^^
37+
38+
- Raising cleaner errors earlier when server returns with error. [#3284]
3539

3640

3741
0.4.10 (2025-03-18)

astroquery/utils/process_asyncs.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
"""
55
import textwrap
66
import functools
7+
from requests import Response
8+
79
from .class_or_instance import class_or_instance
810
from .docstr_chompers import remove_sections
911

@@ -26,6 +28,10 @@ def newmethod(self, *args, **kwargs):
2628
response = getattr(self, async_method_name)(*args, **kwargs)
2729
if kwargs.get('get_query_payload') or kwargs.get('field_help'):
2830
return response
31+
# mast is doing something weird by stacking the responses into a list while also using async_to_sync
32+
# so we have to check for that here until it's refactored
33+
if isinstance(response, Response):
34+
response.raise_for_status()
2935
result = self._parse_result(response, verbose=verbose)
3036
self.table = result
3137
return result

0 commit comments

Comments
 (0)