forked from quic-go/quic-go
fix logging of application errors
This commit is contained in:
@@ -26,12 +26,12 @@ var _ = Describe("QUIC Transport Errors", func() {
|
||||
})
|
||||
|
||||
Context("crypto errors", func() {
|
||||
It("has a string representation for crypto errors with a message", func() {
|
||||
It("has a string representation for errors with a message", func() {
|
||||
err := CryptoError(42, "foobar")
|
||||
Expect(err.Error()).To(Equal("CRYPTO_ERROR: foobar"))
|
||||
})
|
||||
|
||||
It("has a string representation for crypto errors without a message", func() {
|
||||
It("has a string representation for errors without a message", func() {
|
||||
err := CryptoError(42, "")
|
||||
Expect(err.Error()).To(Equal("CRYPTO_ERROR: tls: bad certificate"))
|
||||
})
|
||||
@@ -42,6 +42,18 @@ var _ = Describe("QUIC Transport Errors", func() {
|
||||
})
|
||||
})
|
||||
|
||||
Context("application errors", func() {
|
||||
It("has a string representation for errors with a message", func() {
|
||||
err := ApplicationError(0x42, "foobar")
|
||||
Expect(err.Error()).To(Equal("Application error 0x42: foobar"))
|
||||
})
|
||||
|
||||
It("has a string representation for errors without a message", func() {
|
||||
err := ApplicationError(0x42, "")
|
||||
Expect(err.Error()).To(Equal("Application error 0x42"))
|
||||
})
|
||||
})
|
||||
|
||||
Context("ErrorCode", func() {
|
||||
It("works as error", func() {
|
||||
var err error = StreamStateError
|
||||
|
||||
Reference in New Issue
Block a user