Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add the NO_VIABLE_PATH error #2861

Merged
merged 1 commit into from
Nov 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions internal/qerr/error_codes.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const (
CryptoBufferExceeded ErrorCode = 0xd
KeyUpdateError ErrorCode = 0xe
AEADLimitReached ErrorCode = 0xf
NoViablePathError ErrorCode = 0x10
)

func (e ErrorCode) isCryptoError() bool {
Expand Down Expand Up @@ -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))
Expand Down
2 changes: 2 additions & 0 deletions qlog/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
}
Expand Down
1 change: 1 addition & 0 deletions qlog/types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
})
})
Expand Down