aboutsummaryrefslogtreecommitdiff
path: root/format/sideband64k/errors.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-03-06 16:23:26 +0800
committerGravatar Runxi Yu2026-03-06 16:23:26 +0800
commite808bdaa15b4df61d9575192fc34cde77890da1c (patch)
tree5ca37ced633e43d5228cb0fa62520f1c6a2ca631 /format/sideband64k/errors.go
parentci: Add go-fix (diff)
signatureNo signature
format/sideband64k: Add side-band-64k v0.1.66
Diffstat (limited to 'format/sideband64k/errors.go')
-rw-r--r--format/sideband64k/errors.go30
1 files changed, 30 insertions, 0 deletions
diff --git a/format/sideband64k/errors.go b/format/sideband64k/errors.go
new file mode 100644
index 00000000..c04d7caa
--- /dev/null
+++ b/format/sideband64k/errors.go
@@ -0,0 +1,30 @@
+package sideband64k
+
+import (
+ "errors"
+ "fmt"
+)
+
+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 "<nil>"
+ }
+
+ if e.Reason == "" {
+ return "sideband64k: protocol error"
+ }
+
+ return fmt.Sprintf("sideband64k: protocol error: %s", e.Reason)
+}