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 --- network/protocol/sideband64k/errors.go | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 network/protocol/sideband64k/errors.go (limited to 'network/protocol/sideband64k/errors.go') diff --git a/network/protocol/sideband64k/errors.go b/network/protocol/sideband64k/errors.go new file mode 100644 index 00000000..44e7c165 --- /dev/null +++ b/network/protocol/sideband64k/errors.go @@ -0,0 +1,27 @@ +package sideband64k + +import "errors" + +var ( + // ErrTooLarge indicates a payload exceeds configured sideband data limits. + ErrTooLarge = errors.New("sideband64k: payload too large") + // ErrInvalidBand indicates a data frame has an invalid sideband designator. + ErrInvalidBand = errors.New("sideband64k: invalid band designator") +) + +// ProtocolError reports invalid side-band-64k framing. +type ProtocolError struct { + Reason string +} + +func (e *ProtocolError) Error() string { + if e == nil { + return "" + } + + if e.Reason == "" { + return "sideband64k: protocol error" + } + + return "sideband64k: protocol error: " + e.Reason +} -- cgit v1.3.1-10-gc9f91