Skip to content

Commit ffab988

Browse files
Kathleen Kikerbsipocz
authored andcommitted
Updating request calls to internal requests module
1 parent d5bbca2 commit ffab988

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

astroquery/neodys/core.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,8 @@ def query_object(self, object_id, orbital_element_type="eq", epoch_near_present=
7777

7878
object_url = f'{self.NEODYS_URL}/{object_id}.{orbital_element_type}{epoch_near_present}'
7979

80-
response = requests.get(object_url, timeout=self.TIMEOUT)
81-
82-
if response.status_code != 200:
83-
print(object_url)
84-
raise RuntimeError("Request failed with error {0}: {1}".format(response.status_code, response.text))
80+
response = self._request('GET', object_url, timeout=self.TIMEOUT)
81+
response.raise_for_status()
8582

8683
ascii_text = (response.text).split('\n')
8784

0 commit comments

Comments
 (0)