astropy / astroquery
1
# Licensed under a 3-clause BSD style license - see LICENSE.rst
2 1
"""
3
Custom exceptions used in the astroquery query classes
4
"""
5

6 1
from astropy.utils.exceptions import AstropyWarning
7

8 1
__all__ = ['TimeoutError', 'InvalidQueryError', 'RemoteServiceError',
9
           'TableParseError', 'LoginError', 'ResolverError',
10
           'NoResultsWarning', 'LargeQueryWarning', 'InputWarning',
11
           'AuthenticationWarning', 'MaxResultsWarning']
12

13

14 1
class TimeoutError(Exception):
15

16
    """
17
    Raised on failure to establish connection with server
18
    within a particular time limit
19
    """
20 1
    pass
21

22

23 1
class InvalidQueryError(Exception):
24
    """
25
    Errors related to invalid queries.
26
    """
27 1
    pass
28

29

30 1
class TableParseError(Exception):
31
    """
32
    Errors related to VOTable parsing.
33
    These should be either submitted as issues to astropy or to the originating
34
    service.
35
    """
36 1
    pass
37

38

39 1
class RemoteServiceError(Exception):
40
    """
41
    Errors related to the remote service, i.e. if the service returns an error
42
    page
43
    """
44 1
    pass
45

46

47 1
class LoginError(Exception):
48
    """
49
    Errors due to failed logins.  Should only be raised for services for which
50
    a login is a prerequisite for the requested action
51
    """
52 1
    pass
53

54

55 1
class ResolverError(Exception):
56
    """
57
    Errors due to failing to resolve an object name/id to a specific
58
    sky coordinate.
59
    """
60 1
    pass
61

62

63 1
class NoResultsWarning(AstropyWarning):
64
    """
65
    Astroquery warning class to be issued when a query returns no result.
66
    """
67 1
    pass
68

69

70 1
class LargeQueryWarning(AstropyWarning):
71
    """
72
    Astroquery warning class to be issued when a query is larger than
73
    recommended for a given service.
74
    """
75 1
    pass
76

77

78 1
class InputWarning(AstropyWarning):
79
    """
80
    Astroquery warning class to be issued when user input is incorrect
81
    in some way but doesn't prevent the function from running.
82
    """
83 1
    pass
84

85

86 1
class AuthenticationWarning(AstropyWarning):
87
    """
88
    Astroquery warning class to be issued when there are problems with
89
    user authentication.
90
    """
91

92

93 1
class MaxResultsWarning(AstropyWarning):
94
    """
95
    Astroquery warning class to be issued when the maximum allowed
96
    results are returned.
97
    """
98 1
    pass

Read our documentation on viewing source code .

Loading