forked from cloudfoundry/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
errors.go
73 lines (58 loc) · 1.82 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
65
66
67
68
69
70
71
72
73
package shared
// StartupTimeoutError is returned when startup timeout is reached waiting for
// an application to start.
type StartupTimeoutError struct {
AppName string
}
func (e StartupTimeoutError) Error() string {
return "Timed out waiting for application {{.AppName}} to start"
}
func (e StartupTimeoutError) Translate(translate func(string, ...interface{}) string) string {
return translate(e.Error(), map[string]interface{}{
"AppName": e.AppName,
})
}
type RunTaskError struct {
Message string
}
func (_ RunTaskError) Error() string {
return "Error running task: {{.CloudControllerMessage}}"
}
func (e RunTaskError) Translate(translate func(string, ...interface{}) string) string {
return translate(e.Error(), map[string]interface{}{
"CloudControllerMessage": e.Message,
})
}
type V3APIDoesNotExistError struct {
Message string
}
func (_ V3APIDoesNotExistError) Error() string {
return "{{.Message}}\nNote that this command requires CF API version 3.0.0+."
}
func (e V3APIDoesNotExistError) Translate(translate func(string, ...interface{}) string) string {
return translate(e.Error(), map[string]interface{}{
"Message": e.Message,
})
}
type IsolationSegmentNotFoundError struct {
Name string
}
func (_ IsolationSegmentNotFoundError) Error() string {
return "Isolation segment '{{.Name}}' not found."
}
func (e IsolationSegmentNotFoundError) Translate(translate func(string, ...interface{}) string) string {
return translate(e.Error(), map[string]interface{}{
"Name": e.Name,
})
}
type OrganizationNotFoundError struct {
Name string
}
func (_ OrganizationNotFoundError) Error() string {
return "Organization '{{.Name}}' not found."
}
func (e OrganizationNotFoundError) Translate(translate func(string, ...interface{}) string) string {
return translate(e.Error(), map[string]interface{}{
"Name": e.Name,
})
}