-
Notifications
You must be signed in to change notification settings - Fork 6
/
error.go
34 lines (27 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
package app
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 invalidFlagError = µerror.Error{
Kind: "invalidFlagError",
}
// IsInvalidFlag asserts invalidFlagError.
func IsInvalidFlag(err error) bool {
return microerror.Cause(err) == invalidFlagError
}
// unmashalToMapFailedError is used when a YAML appCatalog values can't be unmarshalled into map[string]interface{}.
var unmashalToMapFailedError = µerror.Error{
Kind: "unmashalToMapFailedError",
Desc: "Could not unmarshal YAML into a map[string]interface{} structure. Seems like the YAML is invalid.",
}
// IsUnmashalToMapFailed asserts unmashalToMapFailedError.
func IsUnmashalToMapFailed(err error) bool {
return microerror.Cause(err) == unmashalToMapFailedError
}