-
Notifications
You must be signed in to change notification settings - Fork 5
/
errors.go
35 lines (28 loc) · 1.08 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
package command
import "errors"
var (
// ErrSkipHears suggests that a handler has dealt with a command,
// and than any subsequent Hears handlers should be skipped.
ErrSkipHears = errors.New("skip hear messages")
// ErrUnknownCommand is returned by a command mux if the command did
// not match any of it's registered handlers.
ErrUnknownCommand = errors.New("unknown command")
// ErrBadCLI implies that we could not process this message as a
// command line. E.g. due to potentially mismatched quoting or bad
// escaping.
ErrBadCLI = errors.New("could not process as command line")
)
// errUsage indicates that Command handler was used incorrectly. The
// string returned is a usage message generated by a call to -help
// for this command
type errUsage string
// Error implements the Error interface for an ErrUsage.
func (e errUsage) Error() string {
return string(e)
}
// ErrUsage indicates that Command handler was used incorrectly. The
// string returned is a usage message generated by a call to -help
// for this command
func ErrUsage(s string) error {
return errUsage(s)
}