/
error.go
39 lines (30 loc) · 961 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 template
import "github.com/giantswarm/microerror"
var componentNotFoundError = µerror.Error{
Kind: "componentNotFound",
}
// IsComponentNotFound asserts componentNotFoundError.
func IsComponentNotFound(err error) bool {
return microerror.Cause(err) == componentNotFoundError
}
var invalidConfigError = µerror.Error{
Kind: "invalidConfigError",
}
// IsInvalidConfig asserts invalidConfigError.
func IsInvalidConfig(err error) bool {
return microerror.Cause(err) == invalidConfigError
}
var retrieveRuntimeError = µerror.Error{
Kind: "retrieveRuntimeError",
}
// IsRetrieveRuntimeError asserts retrieveRuntimeError.
func IsRetrieveRuntimeError(err error) bool {
return microerror.Cause(err) == retrieveRuntimeError
}
var validationError = µerror.Error{
Kind: "validationError",
}
// IsValidationError asserts validationError.
func IsValidationError(err error) bool {
return microerror.Cause(err) == validationError
}