Skip to content

Commit 9fa21b6

Browse files
committed
better range for transport errors
1 parent 3284549 commit 9fa21b6

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

core/network/conn.go

+9-9
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ func (c *ConnError) Unwrap() []error {
4545

4646
const (
4747
ConnNoError ConnErrorCode = 0
48-
ConnProtocolNegotiationFailed ConnErrorCode = 0x0400
49-
ConnResourceLimitExceeded ConnErrorCode = 0x0401
50-
ConnRateLimited ConnErrorCode = 0x0402
51-
ConnProtocolViolation ConnErrorCode = 0x0403
52-
ConnSupplanted ConnErrorCode = 0x0404
53-
ConnGarbageCollected ConnErrorCode = 0x0405
54-
ConnShutdown ConnErrorCode = 0x0406
55-
ConnGated ConnErrorCode = 0x0407
56-
ConnCodeOutOfRange ConnErrorCode = 0x0408
48+
ConnProtocolNegotiationFailed ConnErrorCode = 0x1000
49+
ConnResourceLimitExceeded ConnErrorCode = 0x1001
50+
ConnRateLimited ConnErrorCode = 0x1002
51+
ConnProtocolViolation ConnErrorCode = 0x1003
52+
ConnSupplanted ConnErrorCode = 0x1004
53+
ConnGarbageCollected ConnErrorCode = 0x1005
54+
ConnShutdown ConnErrorCode = 0x1006
55+
ConnGated ConnErrorCode = 0x1007
56+
ConnCodeOutOfRange ConnErrorCode = 0x1008
5757
)
5858

5959
// Conn is a connection to a remote peer. It multiplexes streams.

core/network/mux.go

+9-9
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ func (s *StreamError) Unwrap() []error {
4444

4545
const (
4646
StreamNoError StreamErrorCode = 0
47-
StreamProtocolNegotiationFailed StreamErrorCode = 0x0401
48-
StreamResourceLimitExceeded StreamErrorCode = 0x0402
49-
StreamRateLimited StreamErrorCode = 0x0403
50-
StreamProtocolViolation StreamErrorCode = 0x0404
51-
StreamSupplanted StreamErrorCode = 0x0405
52-
StreamGarbageCollected StreamErrorCode = 0x0406
53-
StreamShutdown StreamErrorCode = 0x0407
54-
StreamGated StreamErrorCode = 0x0408
55-
StreamCodeOutOfRange StreamErrorCode = 0x0409
47+
StreamProtocolNegotiationFailed StreamErrorCode = 0x1001
48+
StreamResourceLimitExceeded StreamErrorCode = 0x1002
49+
StreamRateLimited StreamErrorCode = 0x1003
50+
StreamProtocolViolation StreamErrorCode = 0x1004
51+
StreamSupplanted StreamErrorCode = 0x1005
52+
StreamGarbageCollected StreamErrorCode = 0x1006
53+
StreamShutdown StreamErrorCode = 0x1007
54+
StreamGated StreamErrorCode = 0x1008
55+
StreamCodeOutOfRange StreamErrorCode = 0x1009
5656
)
5757

5858
// MuxedStream is a bidirectional io pipe within a connection.

0 commit comments

Comments
 (0)