-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathNepheleError.py
213 lines (144 loc) · 4.6 KB
/
NepheleError.py
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
"""
Nephele specific exception classes. NepheleError is the base Nephele exception
and it is subclassed by the other exceptions.
"""
class NepheleError(Exception):
"""
Basic exception for errors raised by nephele2.
All neph exceptions should inherit this exception!
"""
VALID_JOB_STATES = ['Pending',
'Pre-Processing',
'Running',
'Failed',
'Succeeded']
def __init__(self, job_id=None, stack_trace=None, msg=None):
super().__init__(msg, job_id)
# if job_id is None:
# job_id = 'Job ID unknown.'
# if msg is None:
# msg = 'No Details.'
self.job_id = job_id
self.msg = msg
self.stack_trace = stack_trace
class S3_404(NepheleError):
"""
getting a 404 on a bucket lookup
System wide.
"""
pass
class S3Error(NepheleError):
""" Unknown General S3 problem, eg bucket not exist."""
pass
class S3JobError(NepheleError):
""" Unknown Job specific S3 problem, eg prefix not exist."""
pass
class S3TransferError(NepheleError):
"""sonething went wrong during file transfer"""
pass
class PresignedUrlError(NepheleError):
""" isuse with creating presigned URL"""
pass
class NepheleEmailError(NepheleError):
"""There was a problem getting an email sent.
"""
pass
class EC2TermError(NepheleError):
"""There was a problem with killing an EC2 machine"""
pass
class NepheleRowNotFound(NepheleError):
"""There was no row with the requested query value in the database.
"""
pass
# def __init__(self, job_id=None, msg=None):
# super().__init__(msg, job_id)
class NepheleBadUserAddress(NepheleError):
"""The requested address is marked as bad.
"""
pass
class NepheleUnregisteredUser(NepheleError):
"""The user was found but has not confirmed the address.
"""
pass
class NepheleInvalidUser(NepheleError):
"""The requested user is either not allowed to perform
actions, or does not exist.
"""
pass
class NepheleInvalidJob(NepheleError):
"""The requested job was not found.
"""
pass
class NepheleDatabaseWriteError(NepheleError):
"""Something went wrong when attempting to write to the database.
"""
pass
# TODO: we may just want to use the BadArgumentException instead of this one
class NepheleMissingArgument(NepheleError):
"""A required argument was passes with a None value.
"""
pass
class NepheleBadArgumentException(NepheleError):
"""A bad argument combination was passed"""
pass
class NepheleNoDBConnectionException(NepheleError):
"""Unable to reach DB."""
pass
class NepheleQueueLookupException(NepheleError):
"""something happened when we were trying to get a queue"""
pass
class NepheleQueueCreationException(NepheleError):
"""Failed to create a queue."""
pass
class PendingNotAvailableException(NepheleError):
""" The Pending Queue is a special queue. If it doesn't exist it's bad."""
pass
class WorkerQueueNotAvailableException(NepheleError):
""" The worker queue is un reachable for some reason."""
pass
class NepheleUnknownTypeException(NepheleError):
"""
Catch all unknown type exception. All I'm doing
is repackaging any unknown exception as an NepheleError
"""
pass
class UnableToStartEC2Exception(NepheleError):
""" something is up with AWS, unable to start EC2"""
pass
class EC2LimitExceededException(NepheleError):
"""We have reached our limit for running EC2 instances"""
pass
class BadJobException(NepheleError):
"""Checked job in DB prior to submit, and is malformed."""
pass
class ScriptException(NepheleError):
"""A script called by Worker._local_exec through an exception"""
pass
class InvalidJobStatus(NepheleError):
"""
Job states must be one of config.VALID_JOB_STATES
"""
pass
class InvalidDataLocation(NepheleError):
"""
Data location must be either temp or retain.
"""
pass
# CLASS NepheleWorkerQueueException(NepheleError):
# """something happened when we were trying to get the worker queue"""
# pass
class NepheleOSError(NepheleError):
"""
Something happened while we were looking for files or moving files around.
"""
pass
class FailedToFindExpectedFileError(NepheleError):
"""If we fail to find an expected file."""
pass
class NoMoreComputeError(NepheleError):
"""< 0 compute time available."""
pass
class NoSuchDirError(NepheleError):
pass
class UnableToRmNFSException(NepheleError):
pass