From 311edcd50f3a84f4b860bde3cb887451d74eaa11 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Wed, 25 Mar 2026 16:22:03 +0000 Subject: network/protocol: Rename from protocol --- protocol/pktline/errors.go | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 protocol/pktline/errors.go (limited to 'protocol/pktline/errors.go') diff --git a/protocol/pktline/errors.go b/protocol/pktline/errors.go deleted file mode 100644 index 866ff467..00000000 --- a/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 "" - } - - if e.Reason == "" { - return "pktline: protocol error" - } - - return "pktline: protocol error: " + e.Reason -} -- cgit v1.3.1-10-gc9f91