add the APPLICATION_ERROR, use it in CONNECTION_CLOSE frames

This commit is contained in:
Marten Seemann
2020-03-21 10:56:36 +07:00
parent 6d61dccc2f
commit 09e16b7602
4 changed files with 8 additions and 9 deletions

View File

@@ -23,6 +23,7 @@ const (
ConnectionIDLimitError ErrorCode = 0x9
ProtocolViolation ErrorCode = 0xa
InvalidToken ErrorCode = 0xb
ApplicationError ErrorCode = 0xc
CryptoBufferExceeded ErrorCode = 0xd
)
@@ -72,6 +73,8 @@ func (e ErrorCode) String() string {
return "PROTOCOL_VIOLATION"
case InvalidToken:
return "INVALID_TOKEN"
case ApplicationError:
return "APPLICATION_ERROR"
case CryptoBufferExceeded:
return "CRYPTO_BUFFER_EXCEEDED"
default:

View File

@@ -16,10 +16,6 @@ type QuicError struct {
var _ net.Error = &QuicError{}
// UserCanceledError is used if the application closes the connection
// before the handshake completes.
var UserCanceledError = &QuicError{ErrorCode: 0x15a}
// NewError creates a new QuicError instance
func NewError(errorCode ErrorCode, errorMessage string) *QuicError {
return &QuicError{