-
Notifications
You must be signed in to change notification settings - Fork 237
/
exceptions.py
249 lines (130 loc) · 5.38 KB
/
exceptions.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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
class CumulusCIException(Exception):
""" Base class for all CumulusCI Exceptions """
pass
class CumulusCIUsageError(CumulusCIException):
""" An exception thrown due to improper usage which should be resolvable by proper usage """
pass
class CumulusCIFailure(CumulusCIException):
""" An exception representing a failure such as a Metadata deployment failure or a test failure. CI systems can handle these to determine fail vs error status """
pass
class NotInProject(CumulusCIUsageError):
""" Raised when no project can be found in the current context """
pass
class ProjectConfigNotFound(CumulusCIUsageError):
""" Raised when a project is found in the current context but no configuration was found for the project """
pass
class ProjectMinimumVersionError(CumulusCIException):
pass
class KeychainNotFound(CumulusCIException):
""" Raised when no keychain could be found """
pass
class KeychainKeyNotFound(CumulusCIUsageError):
""" Raised when the keychain key couldn't be found """
pass
class OrgNotFound(CumulusCIUsageError):
""" Raised when no org could be found by a given name in the project keychain """
pass
class ServiceNotConfigured(CumulusCIUsageError):
""" Raised when no service configuration could be found by a given name in the project keychain """
pass
class ServiceNotValid(CumulusCIUsageError):
""" Raised when no service configuration could be found by a given name in the project configuration """
pass
class DependencyResolutionError(CumulusCIException):
""" Raised when an issue is encountered while resolving a static dependency map """
pass
class ConfigError(CumulusCIException):
""" Raised when a configuration enounters an error """
def __init__(self, message=None, config_name=None):
super(ConfigError, self).__init__(message)
self.message = message
self.config_name = config_name
def __str__(self):
return f"{self.message} for config {self.config_name}"
class ConfigMergeError(ConfigError):
""" Raised when merging configuration fails. """
pass
class AntTargetException(CumulusCIException):
""" Raised when a generic Ant target error occurs """
pass
class DeploymentException(CumulusCIFailure):
""" Raised when a metadata api deployment error occurs """
pass
class ApexTestException(CumulusCIFailure):
""" Raised when a build fails because of an Apex test failure """
pass
class SalesforceCredentialsException(CumulusCIException):
""" Raise when Salesforce credentials are invalid """
pass
class TaskRequiresSalesforceOrg(CumulusCIUsageError):
""" Raise when a task that requires a Salesforce org_config is not initialized with an org_config """
pass
class TaskOptionsError(CumulusCIUsageError):
""" Raise when a task's options are invalid """
pass
class NamespaceNotFoundError(CumulusCIUsageError):
"""Raise when namespace is not found in project includes"""
class TaskNotFoundError(CumulusCIUsageError):
""" Raise when task is not found in project config """
pass
class FlowInfiniteLoopError(CumulusCIUsageError):
""" Raised when a flow configuration creates a infinite loop """
pass
class FlowConfigError(CumulusCIException):
""" Raised when a flow configuration encounters an error """
pass
class FlowNotFoundError(CumulusCIUsageError):
""" Raise when flow is not found in project config """
pass
class FlowNotReadyError(CumulusCIException):
""" Raise when flow is called before it has been prepared """
pass
class ScratchOrgException(CumulusCIException):
""" Raise for errors related to scratch orgs """
pass
class GithubException(CumulusCIException):
""" Raise for errors related to GitHub """
pass
class GithubApiError(CumulusCIException):
pass
class GithubApiNotFoundError(CumulusCIException):
pass
class GithubApiNoResultsError(CumulusCIException):
pass
class GithubApiUnauthorized(CumulusCIException):
pass
class SalesforceException(CumulusCIException):
""" Raise for errors related to Salesforce """
pass
class SalesforceDXException(CumulusCIException):
""" Raise for errors related to Salesforce DX """
pass
class SOQLQueryException(CumulusCIFailure):
""" Raise for errors related to Salesforce DX """
pass
class CommandException(CumulusCIFailure):
""" Raise for errors coming from spawned CLI subprocesses """
pass
class BrowserTestFailure(CumulusCIFailure):
""" Raise when browser tests fail """
pass
class ApexCompilationException(CumulusCIFailure):
""" Raise when apex compilation fails """
def __str__(self):
line, problem = self.args
return f"Apex compilation failed on line {line}: {problem}"
class ApexException(CumulusCIFailure):
""" Raise when an Apex Exception is raised in an org """
def __str__(self):
message, stacktrace = self.args
stacktrace = "\n ".join(stacktrace.splitlines())
return f"Apex error: {message}\n Stacktrace:\n {stacktrace}"
class PushApiObjectNotFound(CumulusCIException):
""" Raise when Salesforce Push API object is not found """
pass
class RobotTestFailure(CumulusCIFailure):
""" Raise when a robot test fails in a test suite """
pass
class BulkDataException(CumulusCIFailure):
""" Raise for errors from bulkdata tasks """
pass