-
Notifications
You must be signed in to change notification settings - Fork 1
/
errors.go
40 lines (31 loc) · 880 Bytes
/
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
package util
import (
"bytemark.co.uk/client/lib"
"fmt"
)
type SubprocessFailedError struct {
Args []string
ExitCode int
Err error
}
func (e *SubprocessFailedError) Error() string {
return fmt.Sprintf("Running %s failed - %s", e.Args[0], e.Err.Error())
}
type NotEnoughArgumentsError struct {
}
func (e NotEnoughArgumentsError) Error() string {
return "Not enough arguments passed to the command!"
}
// UsageDisplayedError is returned by commands when the user entered wrong info and the help was output
type UsageDisplayedError struct {
TheProblem string
}
func (e UsageDisplayedError) Error() string {
return e.TheProblem
}
type WontDeleteNonEmptyGroupError struct {
Group *lib.GroupName
}
func (e WontDeleteNonEmptyGroupError) Error() string {
return fmt.Sprintf("Group %s contains servers, will not be deleted without --recursive\r\n", e.Group)
}