Skip to content

Commit fecf1b3

Browse files
committed
MAINT: switching RuntimeError to be an EmptyResponseError instead for empty responses
1 parent 1674875 commit fecf1b3

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

astroquery/mpc/core.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from ..query import BaseQuery
2121
from . import conf
2222
from ..utils import async_to_sync, class_or_instance
23-
from ..exceptions import InvalidQueryError
23+
from ..exceptions import InvalidQueryError, EmptyResponseError
2424

2525

2626
__all__ = ['MPCClass']
@@ -1183,12 +1183,12 @@ def _parse_result(self, result, **kwargs):
11831183
result.text))
11841184

11851185
if len(src) == 0:
1186-
raise RuntimeError(('No data queried. Are the target '
1187-
'identifiers correct? Is the MPC '
1188-
'database search working for your '
1189-
'object? The service is hosted at '
1190-
'https://www.minorplanetcenter.net/'
1191-
'search_db'))
1186+
raise EmptyResponseError(('No data queried. Are the target '
1187+
'identifiers correct? Is the MPC '
1188+
'database search working for your '
1189+
'object? The service is hosted at '
1190+
'https://www.minorplanetcenter.net/'
1191+
'search_db'))
11921192

11931193
# return raw response if requested
11941194
if self.get_raw_response:

0 commit comments

Comments
 (0)