diff options
| author | 2026-04-02 06:23:30 +0000 | |
|---|---|---|
| committer | 2026-04-02 06:28:39 +0000 | |
| commit | a041d523de389b65b98a5373a8034041db2a8d83 (patch) | |
| tree | 7b423dc735f463be616045f2c3c2095a7737aca7 /network/protocol/pktline/errors.go | |
| parent | research: Add dynamic pack resources (diff) | |
| signature | No signature | |
*: Remove
Diffstat (limited to 'network/protocol/pktline/errors.go')
| -rw-r--r-- | network/protocol/pktline/errors.go | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/network/protocol/pktline/errors.go b/network/protocol/pktline/errors.go deleted file mode 100644 index 866ff467..00000000 --- a/network/protocol/pktline/errors.go +++ /dev/null @@ -1,31 +0,0 @@ -package pktline - -import "errors" - -var ( - // ErrInvalidLength indicates a malformed 4-byte hexadecimal length header. - ErrInvalidLength = errors.New("pktline: invalid length header") - // ErrTooLarge indicates a payload exceeds configured packet data limits. - ErrTooLarge = errors.New("pktline: payload too large") -) - -// ProtocolError reports invalid pkt-line framing. -// -// It is returned for protocol violations such as invalid control values -// (for example 0003) or non-hex length headers. -type ProtocolError struct { - Header [4]byte - Reason string -} - -func (e *ProtocolError) Error() string { - if e == nil { - return "<nil>" - } - - if e.Reason == "" { - return "pktline: protocol error" - } - - return "pktline: protocol error: " + e.Reason -} |
