-
Notifications
You must be signed in to change notification settings - Fork 1
/
error.go
39 lines (30 loc) · 898 Bytes
/
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
package kubelock
import "github.com/giantswarm/microerror"
var alreadyExistsError = µerror.Error{
Kind: "alreadyExistsError",
}
// IsAlreadyExists asserts alreadyExistsError.
func IsAlreadyExists(err error) bool {
return microerror.Cause(err) == alreadyExistsError
}
var notFoundError = µerror.Error{
Kind: "notFoundError",
}
// IsNotFound asserts notFoundError.
func IsNotFound(err error) bool {
return microerror.Cause(err) == notFoundError
}
var invalidConfigError = µerror.Error{
Kind: "invalidConfigError",
}
// IsInvalidConfig asserts invalidConfigError.
func IsInvalidConfig(err error) bool {
return microerror.Cause(err) == invalidConfigError
}
var ownerMismatchError = µerror.Error{
Kind: "ownerMismatchError",
}
// IsOwnerMismatch asserts ownerMismatchError.
func IsOwnerMismatch(err error) bool {
return microerror.Cause(err) == ownerMismatchError
}