Skip to content

Commit

Permalink
Restore original exceptions.
Browse files Browse the repository at this point in the history
  • Loading branch information
mkelley committed Dec 20, 2021
1 parent a8154fd commit 55d6619
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 1 addition & 5 deletions astroquery/jplhorizons/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
from ..query import BaseQuery
# async_to_sync generates the relevant query tools from _async methods
from ..utils import async_to_sync
from ..exceptions import TableParseError
# import configurable items declared in __init__.py
from . import conf

Expand Down Expand Up @@ -1301,10 +1300,7 @@ def _parse_result(self, response, verbose=None):
# this is allowed: if `cache` was set to False, this
# won't be needed
pass
raise TableParseError("Failed to parse JPL Horizons result. "
"The raw response can be found in "
"`self.last_response`. Exception: "
+ str(ex)) from ex
raise
return data


Expand Down
3 changes: 2 additions & 1 deletion astroquery/jplhorizons/tests/test_jplhorizons.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst

from multiprocessing import Value
import pytest
import os
from collections import OrderedDict
Expand Down Expand Up @@ -62,7 +63,7 @@ def test_parse_result(patch_request):
q = jplhorizons.Horizons(id='tlist_error')
# need _last_query to be defined
q._last_query = AstroQuery('GET', 'http://dummy')
with pytest.raises(TableParseError):
with pytest.raises(ValueError):
res = q.ephemerides()


Expand Down

0 comments on commit 55d6619

Please sign in to comment.