forked from criteo/haproxy-spoe-go
/
errors.go
39 lines (36 loc) · 1.19 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
package spoe
type spoeError int
const (
spoeErrorNone spoeError = iota
spoeErrorIO
spoeErrorTimeout
spoeErrorTooBig
spoeErrorInvalid
spoeErrorNoVSN
spoeErrorNoFrameSize
spoeErrorNoCap
spoeErrorBadVsn
spoeErrorBadFrameSize
spoeErrorFragNotSupported
spoeErrorInterlacedFrames
spoeErrorFrameIDNotfound
spoeErrorRes
spoeErrorUnknown spoeError = 99
)
var spoeErrorMessages = map[spoeError]string{
spoeErrorNone: "normal",
spoeErrorIO: "I/O error",
spoeErrorTimeout: "a timeout occurred",
spoeErrorTooBig: "frame is too big",
spoeErrorInvalid: "invalid frame received",
spoeErrorNoVSN: "version value not found",
spoeErrorNoFrameSize: "max-frame-size value not found",
spoeErrorNoCap: "capabilities value not found",
spoeErrorBadVsn: "unsupported version",
spoeErrorBadFrameSize: "max-frame-size too big or too small",
spoeErrorFragNotSupported: "fragmentation not supported",
spoeErrorInterlacedFrames: "invalid interlaced frames",
spoeErrorFrameIDNotfound: "frame-id not found",
spoeErrorRes: "resource allocation error",
spoeErrorUnknown: "an unknown error occurred",
}