forked from quic-go/quic-go
introduce a StreamLimitReachedError for Connection.Open{Uni}Stream (#4579)
Using a concrete type is preferable to relying on interpreting the return values from net.Error.Timeout and net.Error.Temporary, especially since the latter has been deprecated since Go 1.18.
This commit is contained in:
@@ -361,8 +361,7 @@ var _ = Describe("Streams Map (outgoing)", func() {
|
||||
Expect(bf.StreamLimit).To(BeEquivalentTo(6))
|
||||
})
|
||||
_, err := m.OpenStream()
|
||||
Expect(err).To(HaveOccurred())
|
||||
Expect(err.Error()).To(Equal(errTooManyOpenStreams.Error()))
|
||||
Expect(err).To(MatchError(&StreamLimitReachedError{}))
|
||||
})
|
||||
|
||||
It("only sends one STREAMS_BLOCKED frame for one stream ID", func() {
|
||||
@@ -452,8 +451,7 @@ var _ = Describe("Streams Map (outgoing)", func() {
|
||||
}
|
||||
str, err := m.OpenStream()
|
||||
if limit <= n {
|
||||
Expect(err).To(HaveOccurred())
|
||||
Expect(err.Error()).To(Equal(errTooManyOpenStreams.Error()))
|
||||
Expect(err).To(MatchError(&StreamLimitReachedError{}))
|
||||
} else {
|
||||
Expect(str.num).To(Equal(protocol.StreamNum(n + 1)))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user