forked from astropy/astroquery
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexceptions.py
More file actions
129 lines (96 loc) · 2.86 KB
/
exceptions.py
File metadata and controls
129 lines (96 loc) · 2.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Custom exceptions used in the astroquery query classes
"""
from astropy.utils.exceptions import AstropyWarning
__all__ = ['TimeoutError', 'InvalidQueryError', 'RemoteServiceError',
'TableParseError', 'LoginError', 'ResolverError',
'NoResultsWarning', 'LargeQueryWarning', 'InputWarning',
'AuthenticationWarning', 'MaxResultsWarning', 'CorruptDataWarning',
'EmptyResponseError', 'BlankResponseWarning']
class TimeoutError(Exception):
"""
Raised on failure to establish connection with server
within a particular time limit
"""
pass
class InvalidQueryError(Exception):
"""
Errors related to invalid queries.
"""
pass
class TableParseError(Exception):
"""
Errors related to VOTable parsing.
These should be either submitted as issues to astropy or to the originating
service.
"""
pass
class RemoteServiceError(Exception):
"""
Errors related to the remote service, i.e. if the service returns an error
page
"""
pass
class LoginError(Exception):
"""
Errors due to failed logins. Should only be raised for services for which
a login is a prerequisite for the requested action
"""
pass
class ResolverError(Exception):
"""
Errors due to failing to resolve an object name/id to a specific
sky coordinate.
"""
pass
class NoResultsWarning(AstropyWarning):
"""
Astroquery warning class to be issued when a query returns no result.
"""
pass
class LargeQueryWarning(AstropyWarning):
"""
Astroquery warning class to be issued when a query is larger than
recommended for a given service.
"""
pass
class InputWarning(AstropyWarning):
"""
Astroquery warning class to be issued when user input is incorrect
in some way but doesn't prevent the function from running.
"""
pass
class AuthenticationWarning(AstropyWarning):
"""
Astroquery warning class to be issued when there are problems with
user authentication.
"""
class MaxResultsWarning(AstropyWarning):
"""
Astroquery warning class to be issued when the maximum allowed
results are returned.
"""
pass
class CorruptDataWarning(AstropyWarning):
"""
Astroquery warning class to be issued when there is a sign that the
(partially) downloaded data are corrupt.
"""
pass
class EmptyResponseError(ValueError):
"""
Astroquery error class to be raised when the query returns an empty result
"""
pass
class BlankResponseWarning(AstropyWarning):
"""
Astroquery warning to be raised if one or more rows in a table are bad, but
not all rows are.
"""
pass
class CloudAccessWarning(AstropyWarning):
"""
Astroquery warning to be raised if cloud access cannot be enabled.
"""
pass