Skip to content

Commit

Permalink
MAINT: switching RuntimeError to be an EmptyResponseError instead for…
Browse files Browse the repository at this point in the history
… empty responses
  • Loading branch information
bsipocz committed May 9, 2023
1 parent 1674875 commit fecf1b3
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions astroquery/mpc/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from ..query import BaseQuery
from . import conf
from ..utils import async_to_sync, class_or_instance
from ..exceptions import InvalidQueryError
from ..exceptions import InvalidQueryError, EmptyResponseError


__all__ = ['MPCClass']
Expand Down Expand Up @@ -1183,12 +1183,12 @@ def _parse_result(self, result, **kwargs):
result.text))

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

# return raw response if requested
if self.get_raw_response:
Expand Down

0 comments on commit fecf1b3

Please sign in to comment.