diff --git a/internal/qerr/quic_error.go b/internal/qerr/quic_error.go index 18a26fdbc..73ae2e249 100644 --- a/internal/qerr/quic_error.go +++ b/internal/qerr/quic_error.go @@ -65,9 +65,14 @@ func (e *QuicError) Error() string { } return fmt.Sprintf("Application error %#x: %s", uint64(e.ErrorCode), e.ErrorMessage) } - str := e.ErrorCode.String() - if e.FrameType != 0 { - str += fmt.Sprintf(" (frame type: %#x)", e.FrameType) + var str string + if e.isTimeout { + str = "Timeout" + } else { + str = e.ErrorCode.String() + if e.FrameType != 0 { + str += fmt.Sprintf(" (frame type: %#x)", e.FrameType) + } } msg := e.ErrorMessage if len(msg) == 0 { diff --git a/internal/qerr/quic_error_test.go b/internal/qerr/quic_error_test.go index 4d547287a..ccf294f30 100644 --- a/internal/qerr/quic_error_test.go +++ b/internal/qerr/quic_error_test.go @@ -33,7 +33,7 @@ var _ = Describe("QUIC Transport Errors", func() { It("has a string representation for timeout errors", func() { err := NewTimeoutError("foobar") Expect(err.Timeout()).To(BeTrue()) - Expect(err.Error()).To(Equal("NO_ERROR: foobar")) + Expect(err.Error()).To(Equal("Timeout: foobar")) }) Context("crypto errors", func() {