-
Notifications
You must be signed in to change notification settings - Fork 6
/
error.go
255 lines (198 loc) · 6.89 KB
/
error.go
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
250
251
252
253
254
255
package login
import "github.com/giantswarm/microerror"
var fileExistsError = µerror.Error{
Kind: "fileExistsError",
}
// IsFileExistsError asserts fileExistsError.
func IsFileExistsError(err error) bool {
return microerror.Cause(err) == fileExistsError
}
var invalidConfigError = µerror.Error{
Kind: "invalidConfigError",
}
// IsInvalidConfig asserts invalidConfigError.
func IsInvalidConfig(err error) bool {
return microerror.Cause(err) == invalidConfigError
}
var invalidFlagError = µerror.Error{
Kind: "invalidFlagError",
}
// IsInvalidFlag asserts invalidFlagError.
func IsInvalidFlag(err error) bool {
return microerror.Cause(err) == invalidFlagError
}
var invalidAuthResult = µerror.Error{
Kind: "invalidAuthResult",
}
// IsInvalidAuthResult asserts invalidAuthResult.
func IsInvalidAuthResult(err error) bool {
return microerror.Cause(err) == invalidAuthResult
}
var unknownUrlError = µerror.Error{
Kind: "unknownUrlError",
}
// IsUnknownUrl asserts unknownUrlError.
func IsUnknownUrl(err error) bool {
return microerror.Cause(err) == unknownUrlError
}
var contextDoesNotExistError = µerror.Error{
Kind: "contextDoesNotExistError",
}
// IsContextDoesNotExist asserts contextDoesNotExistError.
func IsContextDoesNotExist(err error) bool {
return microerror.Cause(err) == contextDoesNotExistError
}
var incorrectConfigurationError = µerror.Error{
Kind: "incorrectConfigurationError",
}
// IsIncorrectConfiguration asserts incorrectConfigurationError.
func IsIncorrectConfiguration(err error) bool {
return microerror.Cause(err) == incorrectConfigurationError
}
var tokenRenewalFailedError = µerror.Error{
Kind: "tokenRenewalFailedError",
}
// IsTokenRenewalFailed asserts tokenRenewalFailedError.
func IsTokenRenewalFailed(err error) bool {
return microerror.Cause(err) == tokenRenewalFailedError
}
var selectedContextNonCompatibleError = µerror.Error{
Kind: "selectedContextNonCompatibleError",
}
// IsSelectedTokenNonCompatible asserts selectedContextNonCompatibleError.
func IsSelectedTokenNonCompatible(err error) bool {
return microerror.Cause(err) == selectedContextNonCompatibleError
}
var contextAlreadySelectedError = µerror.Error{
Kind: "contextAlreadySelectedError",
}
// IsContextAlreadySelected asserts contextAlreadySelectedError.
func IsContextAlreadySelected(err error) bool {
return microerror.Cause(err) == contextAlreadySelectedError
}
var invalidAuthConfigurationError = µerror.Error{
Kind: "invalidAuthConfigurationError",
}
// IsInvalidAuthConfiguration asserts invalidAuthConfigurationError.
func IsInvalidAuthConfiguration(err error) bool {
return microerror.Cause(err) == invalidAuthConfigurationError
}
var newLoginRequiredError = µerror.Error{
Kind: "newLoginRequiredError",
}
// IsNewLoginRequired asserts newLoginRequiredError.
func IsNewLoginRequired(err error) bool {
return microerror.Cause(err) == newLoginRequiredError
}
var authResponseTimedOutError = µerror.Error{
Kind: "authResponseTimedOutError",
}
// IsAuthResponseTimedOut asserts authResponseTimedOutError.
func IsAuthResponseTimedOut(err error) bool {
return microerror.Cause(err) == authResponseTimedOutError
}
var credentialRetrievalTimedOut = µerror.Error{
Kind: "credentialRetrievalTimedOut",
}
// IsCredentialRetrievalTimedOut asserts credentialRetrievalTimedOut.
func IsCredentialRetrievalTimedOut(err error) bool {
return microerror.Cause(err) == credentialRetrievalTimedOut
}
var organizationNotFoundError = µerror.Error{
Kind: "organizationNotFoundError",
}
// IsOrganizationNotFound asserts organizationNotFoundError.
func IsOrganizationNotFound(err error) bool {
return microerror.Cause(err) == organizationNotFoundError
}
var unknownOrganizationNamespaceError = µerror.Error{
Kind: "unknownOrganizationNamespaceError",
}
// IsUnknownOrganizationNamespace asserts unknownOrganizationNamespaceError.
func IsUnknownOrganizationNamespace(err error) bool {
return microerror.Cause(err) == unknownOrganizationNamespaceError
}
var clusterNotFoundError = µerror.Error{
Kind: "clusterNotFoundError",
}
// IsClusterNotFound asserts clusterNotFoundError.
func IsClusterNotFound(err error) bool {
return microerror.Cause(err) == clusterNotFoundError
}
var invalidReleaseVersionError = µerror.Error{
Kind: "invalidReleaseVersionError",
}
// IsInvalidReleaseVersion asserts invalidReleaseVersionError.
func IsInvalidReleaseVersion(err error) bool {
return microerror.Cause(err) == invalidReleaseVersionError
}
var unsupportedReleaseVersionError = µerror.Error{
Kind: "unsupportedReleaseVersionError",
}
// IsUnsupportedReleaseVersion asserts unsupportedReleaseVersionError.
func IsUnsupportedReleaseVersion(err error) bool {
return microerror.Cause(err) == unsupportedReleaseVersionError
}
var missingComponentError = µerror.Error{
Kind: "missingComponentError",
}
// IsMissingComponent asserts missingComponentError.
func IsMissingComponent(err error) bool {
return microerror.Cause(err) == missingComponentError
}
var unsupportedProviderError = µerror.Error{
Kind: "unsupportedProviderError",
}
// IsUnsupportedProvider asserts unsupportedProviderError.
func IsUnsupportedProvider(err error) bool {
return microerror.Cause(err) == unsupportedProviderError
}
var releaseNotFoundError = µerror.Error{
Kind: "releaseNotFoundError",
}
// IsReleaseNotFound asserts releaseNotFoundError.
func IsReleaseNotFound(err error) bool {
return microerror.Cause(err) == releaseNotFoundError
}
var noOrganizationsError = µerror.Error{
Kind: "noOrganizationsError",
}
// IsNoOrganizations asserts noOrganizationsError.
func IsNoOrganizations(err error) bool {
return microerror.Cause(err) == noOrganizationsError
}
var multipleClustersFoundError = µerror.Error{
Kind: "multipleClustersFoundError",
}
// IsMultipleClustersFound asserts multipleClustersFoundError.
func IsMultipleClustersFound(err error) bool {
return microerror.Cause(err) == multipleClustersFoundError
}
var insufficientPermissionsError = µerror.Error{
Kind: "insufficientPermissionsError",
}
// IsInsufficientPermissions asserts insufficientPermissionsError.
func IsInsufficientPermissions(err error) bool {
return microerror.Cause(err) == insufficientPermissionsError
}
var clusterAPINotReadyError = µerror.Error{
Kind: "clusterAPINotReadyError",
}
// IsClusterAPINotReady asserts clusterAPINotReadyError.
func IsClusterAPINotReady(err error) bool {
return microerror.Cause(err) == clusterAPINotReadyError
}
var clusterAPINotKnownError = µerror.Error{
Kind: "clusterAPINotKnownError",
}
// IsClusterAPINotKnown asserts clusterAPINotKnownError.
func IsClusterAPINotKnown(err error) bool {
return microerror.Cause(err) == clusterAPINotKnownError
}
var deviceAuthError = µerror.Error{
Kind: "deviceAuthError",
}
// IsDeviceAuthError asserts deviceAuthError.
func IsDeviceAuthError(err error) bool {
return microerror.Cause(err) == deviceAuthError
}