-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy patherrors.go
45 lines (36 loc) · 1.04 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
package unison
import "fmt"
// DuplicateCommandError command error
type DuplicateCommandError struct {
Existing *Command
New *Command
Name string
}
func (e DuplicateCommandError) Error() string {
return fmt.Sprintf("commands: name/alias '%s' already exists", e.Name)
}
// DuplicateEventHookError event hook error
type DuplicateEventHookError struct {
Existing *EventHook
New *EventHook
Name string
}
func (e DuplicateEventHookError) Error() string {
return fmt.Sprintf("event hooks: name '%s' already exists", e.Name)
}
// DuplicateServiceError service error
type DuplicateServiceError struct {
Existing *Service
New *Service
Name string
}
func (e DuplicateServiceError) Error() string {
return fmt.Sprintf("service: name '%s' already exists", e.Name)
}
// TooShortCommandPrefixError short command prefix error
type TooShortCommandPrefixError struct {
Prefix string
}
func (e TooShortCommandPrefixError) Error() string {
return fmt.Sprintf("command prefix: '%s' is too short, must me minimum 1 char", e.Prefix)
}