Skip to content

Commit 05331b3

Browse files
committed
fix tests to raise non-200 status code messages
1 parent 7c02364 commit 05331b3

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

astroquery/esa/euclid/core.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,6 @@ def get_status_messages(self, verbose=False):
757757
sub_context = self.EUCLID_MESSAGES
758758
conn_handler = self._TapPlus__getconnhandler()
759759
response = conn_handler.execute_tapget(sub_context, verbose=verbose)
760-
response.raise_for_status()
761760
if response.status == 200:
762761
if isinstance(response, Iterable):
763762
for line in response:
@@ -768,6 +767,8 @@ def get_status_messages(self, verbose=False):
768767
print(e)
769768
except IndexError:
770769
print("Archive down for maintenance")
770+
else:
771+
raise HTTPError(f"Failed to retrieve status messages. HTTP status code: {response.status}")
771772

772773
@staticmethod
773774
def __set_dirs(output_file, observation_id):

astroquery/esa/jwst/core.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,11 +697,12 @@ def get_status_messages(self):
697697
subContext = conf.JWST_MESSAGES
698698
connHandler = self.__jwsttap._TapPlus__getconnhandler()
699699
response = connHandler.execute_tapget(subContext, verbose=False)
700-
response.raise_for_status()
701700
if response.status == 200:
702701
for line in response:
703702
string_message = line.decode("utf-8")
704703
print(string_message[string_message.index('=') + 1:])
704+
else:
705+
raise HTTPError(f"Failed to retrieve status messages. HTTP status code: {response.status}")
705706

706707
def get_product_list(self, *, observation_id=None,
707708
cal_level="ALL",

astroquery/gaia/core.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1171,7 +1171,6 @@ def get_status_messages(self):
11711171
sub_context = self.GAIA_MESSAGES
11721172
conn_handler = self._TapPlus__getconnhandler()
11731173
response = conn_handler.execute_tapget(sub_context, verbose=False)
1174-
response.raise_for_status()
11751174
if response.status == 200:
11761175
if isinstance(response, Iterable):
11771176
for line in response:
@@ -1182,6 +1181,8 @@ def get_status_messages(self):
11821181
print(e)
11831182
except IndexError:
11841183
print("Archive down for maintenance")
1184+
else:
1185+
raise HTTPError(f"Failed to retrieve status messages. HTTP status code: {response.status}")
11851186

11861187

11871188
Gaia = GaiaClass(show_server_messages=False)

0 commit comments

Comments
 (0)