forked from fluxcd/flux
/
errors.go
64 lines (42 loc) · 1.46 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package http
import (
"errors"
"github.com/weaveworks/flux"
)
var ErrorDeprecated = &flux.BaseError{
Help: `The API endpoint requested appears to have been deprecated.
This indicates your client (fluxctl) needs to be updated: please see
https://github.com/weaveworks/flux/releases
If you still have this problem after upgrading, please file an issue at
https://github.com/weaveworks/flux/issues
mentioning what you were attempting to do, and the output of
fluxctl status
`,
Err: errors.New("API endpoint deprecated"),
}
var ErrorUnauthorized = &flux.BaseError{
Help: `The request failed authentication
This most likely means you have a missing or incorrect token. Please
make sure you supply a service token, either by setting the
environment variable FLUX_SERVICE_TOKEN, or using the argument --token
with fluxctl.
`,
Err: errors.New("request failed authentication"),
}
func MakeAPINotFound(path string) *flux.BaseError {
return &flux.BaseError{
Help: `The API endpoint requested is not supported by this server.
This indicates that your client (probably fluxctl) is either out of
date, or faulty. Please see
https://github.com/weaveworks/flux/releases
for releases of fluxctl.
If you still have problems, please file an issue at
https://github.com/weaveworks/flux/issues
mentioning what you were attempting to do, and the output of
fluxctl status
and include this path:
` + path + `
`,
Err: errors.New("API endpoint not found"),
}
}