-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy patherrors.go
More file actions
35 lines (31 loc) · 1.53 KB
/
errors.go
File metadata and controls
35 lines (31 loc) · 1.53 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
package lneto
type errGeneric uint8
// Generic errors common to internet functioning.
const (
_ errGeneric = iota // non-initialized err
ErrBug // lneto-bug(use build tag "debugheaplog")
ErrPacketDrop // packet dropped
ErrBadCRC // incorrect checksum
ErrZeroSource // zero source(port/addr)
ErrZeroDestination // zero destination(port/addr)
ErrShortBuffer // short buffer
ErrBufferFull // buffer full
ErrInvalidAddr // invalid address
ErrUnsupported // unsupported
ErrMismatch // mismatch
ErrMismatchLen // mismatched length
ErrInvalidConfig // invalid configuration
ErrInvalidField // invalid field
ErrInvalidLengthField // invalid length field
ErrExhausted // resource exhausted
ErrAlreadyRegistered // protocol already registered
ErrTruncatedFrame // truncated frame
// Below are potentially good future error additions
// based on one or two encountered use cases, example use case included.
/*
- ErrUnregistered/ErrAborted // connection unregistered. i.e: ICMP client aborted during active ping, ping process returns this.
*/
)
func (err errGeneric) Error() string {
return err.String()
}