-
Notifications
You must be signed in to change notification settings - Fork 22
/
error.go
41 lines (32 loc) · 1.08 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
package hamaster
import "github.com/giantswarm/microerror"
var invalidConfigError = µerror.Error{
Kind: "invalidConfigError",
}
// IsInvalidConfig asserts invalidConfigError.
func IsInvalidConfig(err error) bool {
return microerror.Cause(err) == invalidConfigError
}
var notFoundError = µerror.Error{
Kind: "notFoundError",
}
// IsNotFound asserts notFoundError.
func IsNotFound(err error) bool {
return microerror.Cause(err) == notFoundError
}
var tooManyCRsError = µerror.Error{
Kind: "tooManyCRsError",
Desc: "There is only a single G8sControlPlane CR allowed with the current implementation.",
}
// IsTooManyCRsError asserts tooManyCRsError.
func IsTooManyCRsError(err error) bool {
return microerror.Cause(err) == tooManyCRsError
}
var availabilityZonesNilError = µerror.Error{
Kind: "availabilityZonesNilError",
Desc: "The availability zones in AWSControlPlane CR must not be nil.",
}
// IsAvalailabilityZonesNilError asserts tooManyCRsError.
func IsAvalailabilityZonesNilError(err error) bool {
return microerror.Cause(err) == availabilityZonesNilError
}