-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherror.go
More file actions
48 lines (36 loc) · 1.26 KB
/
error.go
File metadata and controls
48 lines (36 loc) · 1.26 KB
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
package flow
import "fmt"
const (
// ErrClosed is reported for a pending acknowledgement after
// the broker was closed.
ErrClosed = errorString("closed")
// ErrTimeout is reported when a request times out while waiting
// for a response.
ErrTimeout = errorString("timeout")
errMalformedKey = errorString("malformed key")
errMalformedKeys = errorString("malformed keys")
errMalformedFrame = protocolError("malformed frame")
errMalformedJoin = protocolError("malformed join")
errMalformedLeave = protocolError("malformed leave")
errMalformedInfo = protocolError("malformed info")
errMalformedPing = protocolError("malformed ping")
errMalformedMsg = protocolError("malformed msg")
errMalformedFwd = protocolError("malformed fwd")
errMalformedAck = protocolError("malformed ack")
errMalformedMessage = protocolError("malformed message")
)
type errorString string
func errorf(format string, args ...interface{}) error {
return errorString(fmt.Sprintf(format, args...))
}
func (e errorString) Error() string {
return string(e)
}
type optionError string
func (e optionError) Error() string {
return "invalid option: " + string(e)
}
type protocolError string
func (e protocolError) Error() string {
return "protocol error: " + string(e)
}