forked from quic-go/quic-go
add the NO_VIABLE_PATH error
This commit is contained in:
@@ -27,6 +27,7 @@ const (
|
||||
CryptoBufferExceeded ErrorCode = 0xd
|
||||
KeyUpdateError ErrorCode = 0xe
|
||||
AEADLimitReached ErrorCode = 0xf
|
||||
NoViablePathError ErrorCode = 0x10
|
||||
)
|
||||
|
||||
func (e ErrorCode) isCryptoError() bool {
|
||||
@@ -83,6 +84,8 @@ func (e ErrorCode) String() string {
|
||||
return "KEY_UPDATE_ERROR"
|
||||
case AEADLimitReached:
|
||||
return "AEAD_LIMIT_REACHED"
|
||||
case NoViablePathError:
|
||||
return "NO_VIABLE_PATH"
|
||||
default:
|
||||
if e.isCryptoError() {
|
||||
return fmt.Sprintf("CRYPTO_ERROR (%#x)", uint16(e))
|
||||
|
||||
@@ -213,6 +213,8 @@ func (e transportError) String() string {
|
||||
return "key_update_error"
|
||||
case qerr.AEADLimitReached:
|
||||
return "aead_limit_reached"
|
||||
case qerr.NoViablePathError:
|
||||
return "no_viable_path"
|
||||
default:
|
||||
return ""
|
||||
}
|
||||
|
||||
@@ -121,6 +121,7 @@ var _ = Describe("Types", func() {
|
||||
Expect(transportError(qerr.InvalidToken).String()).To(Equal("invalid_token"))
|
||||
Expect(transportError(qerr.ApplicationError).String()).To(Equal("application_error"))
|
||||
Expect(transportError(qerr.CryptoBufferExceeded).String()).To(Equal("crypto_buffer_exceeded"))
|
||||
Expect(transportError(qerr.NoViablePathError).String()).To(Equal("no_viable_path"))
|
||||
Expect(transportError(1337).String()).To(BeEmpty())
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user