aboutsummaryrefslogtreecommitdiff
path: root/protocol/v0v1/server/errors.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-03-07 14:24:05 +0800
committerGravatar Runxi Yu2026-03-07 17:01:46 +0800
commit4b8d39764f9b54ea3090d0fea92a23025dbea30d (patch)
treecaa6e408c4ea625afcbb1b4aa4fb9e945f46994b /protocol/v0v1/server/errors.go
parentrefstore: Split files (diff)
signatureNo signature
protocol: Add v0v1 server protocol and its receivepack subprotocol
Diffstat (limited to 'protocol/v0v1/server/errors.go')
-rw-r--r--protocol/v0v1/server/errors.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/protocol/v0v1/server/errors.go b/protocol/v0v1/server/errors.go
new file mode 100644
index 00000000..6a456234
--- /dev/null
+++ b/protocol/v0v1/server/errors.go
@@ -0,0 +1,18 @@
+package server
+
+// ProtocolError reports one malformed or unsupported protocol input.
+type ProtocolError struct {
+ Reason string
+}
+
+// Error returns the formatted error string.
+func (err *ProtocolError) Error() string {
+ return "protocol/v0v1/server: protocol error: " + err.Reason
+}
+
+// ErrUnexpectedPacket reports one unexpected pkt-line control packet.
+var ErrUnexpectedPacket = &ProtocolError{Reason: "unexpected control packet"}
+
+// ErrSideBandNotEnabled reports one attempt to write sideband frames without a
+// negotiated side-band-64k session.
+var ErrSideBandNotEnabled = &ProtocolError{Reason: "side-band-64k not enabled"}