-
Notifications
You must be signed in to change notification settings - Fork 1
/
errors.go
35 lines (24 loc) · 1.42 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 hacket
import "errors"
var (
// ErrInvalidProtocol supplied protocol is invalid
ErrInvalidProtocol = errors.New("invalid or unrecognizable protocol string")
// ErrMissingPacketConn no connection was supplied or it is nil
ErrMissingPacketConn = errors.New("mising packet connection or connection is nil")
// ErrPacketServiceShutdown packet service is shutdown or in the the process of closing
ErrPacketServiceShutdown = errors.New("packet service is shut down or in the process of shutting down")
// ErrNilPacketHander cannot supply a nil packet handler
ErrNilPacketHander = errors.New("nil packet handler")
// ErrPacketHandlerNotFound missing or unable to find packet handler
ErrPacketHandlerNotFound = errors.New("packet handler not found")
// ErrPacketHandlerAlreadyExists cannot create packet handler because it already exists
ErrPacketHandlerAlreadyExists = errors.New("packet handler already exists with supplied packet type")
// ErrNilByteSlice Slice the byte slice passed was nil
ErrNilByteSlice = errors.New("nil byte slice supplied")
// ErrMaxMessageSize message is to large
ErrMaxMessageSize = errors.New("message size excceed max packet size")
//ErrByteWrite unable to write all of the bytes to the supplied packet
ErrByteWrite = errors.New("failed to write all bytes to packet")
//ErrNilConn is returned when trying to use the server with a nil connection
ErrNilConn = errors.New("no packet connection")
)