forked from grafana/tanka
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patherrors.go
43 lines (32 loc) · 1.1 KB
/
errors.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
package client
import "fmt"
// ErrorNotFound means that the requested object is not found on the server
type ErrorNotFound struct {
errOut string
}
func (e ErrorNotFound) Error() string {
return e.errOut
}
// ErrorUnknownResource means that the requested resource type is unknown to the
// server
type ErrorUnknownResource struct {
errOut string
}
func (e ErrorUnknownResource) Error() string {
return e.errOut
}
// ErrorNoContext means that the context that was searched for couldn't be found
type ErrorNoContext string
func (e ErrorNoContext) Error() string {
return fmt.Sprintf("no context named `%s` was found. Please check your $KUBECONFIG", string(e))
}
// ErrorNoCluster means that the cluster that was searched for couldn't be found
type ErrorNoCluster string
func (e ErrorNoCluster) Error() string {
return fmt.Sprintf("no cluster that matches the apiServer `%s` was found. Please check your $KUBECONFIG", string(e))
}
// ErrorNothingReturned means that there was no output returned
type ErrorNothingReturned struct{}
func (e ErrorNothingReturned) Error() string {
return "kubectl returned no output"
}