-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherrors.go
More file actions
36 lines (30 loc) · 1.03 KB
/
errors.go
File metadata and controls
36 lines (30 loc) · 1.03 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
package pixie
import (
"errors"
"fmt"
)
type StreamError struct {
StreamId uint32
CloseReason CloseReason
}
var (
eInvalidPacket = errors.New("pixie: invalid packet type")
ePacketTooSmall = errors.New("pixie: packet too small")
eVersion = errors.New("pixie: incompatible protocol version")
eMaxStreams = errors.New("pixie: maximum stream count reached")
ePixieClosed = errors.New("pixie: multiplexor closed")
eInvalidExtension = errors.New("pixie: invalid extension")
eClosedSocket = errors.New("pixie: websocket closed")
eFailedHandshake = errors.New("pixie: Handshake failed")
eAuthFail = errors.New("pixie: authentication failed")
eCertAuthFail = errors.New("pixie: certificate authentication failed")
ErrPacketTooSmall = ePacketTooSmall
ErrInvalidPacket = eInvalidPacket
ErrPixieClosed = ePixieClosed
)
func (e *StreamError) Error() string {
return fmt.Sprintf("stream %d closed: %s", e.StreamId, e.CloseReason)
}
func (e *StreamError) Unwrap() error {
return e.CloseReason
}