mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-06 05:37:36 +03:00
fix incorrect usage of errors.Is
errors.Is is supposed to used for equality of errors, not for type assertions. That's what errors.As is there for.
This commit is contained in:
parent
a887f8f436
commit
dbb517858e
10 changed files with 37 additions and 133 deletions
|
@ -2182,7 +2182,7 @@ var _ = Describe("Session", func() {
|
|||
cryptoSetup.EXPECT().Close()
|
||||
gomock.InOrder(
|
||||
tracer.EXPECT().ClosedConnection(gomock.Any()).Do(func(e error) {
|
||||
Expect(errors.Is(e, &IdleTimeoutError{})).To(BeTrue())
|
||||
Expect(e).To(MatchError(&qerr.IdleTimeoutError{}))
|
||||
}),
|
||||
tracer.EXPECT().Close(),
|
||||
)
|
||||
|
@ -2206,7 +2206,7 @@ var _ = Describe("Session", func() {
|
|||
cryptoSetup.EXPECT().Close()
|
||||
gomock.InOrder(
|
||||
tracer.EXPECT().ClosedConnection(gomock.Any()).Do(func(e error) {
|
||||
Expect(errors.Is(e, &HandshakeTimeoutError{})).To(BeTrue())
|
||||
Expect(e).To(MatchError(&HandshakeTimeoutError{}))
|
||||
}),
|
||||
tracer.EXPECT().Close(),
|
||||
)
|
||||
|
@ -2235,8 +2235,10 @@ var _ = Describe("Session", func() {
|
|||
})
|
||||
gomock.InOrder(
|
||||
tracer.EXPECT().ClosedConnection(gomock.Any()).Do(func(e error) {
|
||||
Expect(errors.Is(e, &IdleTimeoutError{})).To(BeFalse())
|
||||
Expect(errors.Is(e, &HandshakeTimeoutError{})).To(BeFalse())
|
||||
idleTimeout := &IdleTimeoutError{}
|
||||
handshakeTimeout := &HandshakeTimeoutError{}
|
||||
Expect(errors.As(e, &idleTimeout)).To(BeFalse())
|
||||
Expect(errors.As(e, &handshakeTimeout)).To(BeFalse())
|
||||
}),
|
||||
tracer.EXPECT().Close(),
|
||||
)
|
||||
|
@ -2263,7 +2265,7 @@ var _ = Describe("Session", func() {
|
|||
cryptoSetup.EXPECT().Close()
|
||||
gomock.InOrder(
|
||||
tracer.EXPECT().ClosedConnection(gomock.Any()).Do(func(e error) {
|
||||
Expect(errors.Is(e, &IdleTimeoutError{})).To(BeTrue())
|
||||
Expect(e).To(MatchError(&IdleTimeoutError{}))
|
||||
}),
|
||||
tracer.EXPECT().Close(),
|
||||
)
|
||||
|
@ -2292,7 +2294,7 @@ var _ = Describe("Session", func() {
|
|||
cryptoSetup.EXPECT().Close()
|
||||
gomock.InOrder(
|
||||
tracer.EXPECT().ClosedConnection(gomock.Any()).Do(func(e error) {
|
||||
Expect(errors.Is(e, &IdleTimeoutError{})).To(BeTrue())
|
||||
Expect(e).To(MatchError(&IdleTimeoutError{}))
|
||||
}),
|
||||
tracer.EXPECT().Close(),
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue