include the frame type in the QuicError error message

This commit is contained in:
Marten Seemann
2019-11-08 12:54:05 +07:00
parent 2c2b5da612
commit 76c742a43d
3 changed files with 41 additions and 4 deletions

View File

@@ -31,11 +31,20 @@ func (e ErrorCode) isCryptoError() bool {
func (e ErrorCode) Error() string {
if e.isCryptoError() {
return fmt.Sprintf("%s: %s", e.String(), qtls.Alert(e-0x100).Error())
return fmt.Sprintf("%s: %s", e.String(), e.Message())
}
return e.String()
}
// Message is a description of the error.
// It only returns a non-empty string for crypto errors.
func (e ErrorCode) Message() string {
if !e.isCryptoError() {
return ""
}
return qtls.Alert(e - 0x100).Error()
}
func (e ErrorCode) String() string {
switch e {
case NoError: