forked from quic-go/quic-go
add a message to crypto errors
The string representation varies depending on the message: * if there's no message, the TLS alert is used * if there's a message, it is used instead
This commit is contained in:
@@ -31,9 +31,10 @@ func TimeoutError(errorMessage string) *QuicError {
|
||||
}
|
||||
|
||||
// CryptoError create a new QuicError instance for a crypto error
|
||||
func CryptoError(tlsAlert uint8) *QuicError {
|
||||
func CryptoError(tlsAlert uint8, errorMessage string) *QuicError {
|
||||
return &QuicError{
|
||||
ErrorCode: 0x100 + ErrorCode(tlsAlert),
|
||||
ErrorCode: 0x100 + ErrorCode(tlsAlert),
|
||||
ErrorMessage: errorMessage,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user