]> Cypherpunks repositories - gostls13.git/commit
net/http: add errors.As support for x/net/http2.StreamError
authorAkshay Shah <akshay@akshayshah.org>
Mon, 22 Aug 2022 23:08:13 +0000 (16:08 -0700)
committerGopher Robot <gobot@golang.org>
Fri, 26 Aug 2022 18:03:42 +0000 (18:03 +0000)
commit4d13aabdf62a15d19a6f41a781aa7e85f02f3f26
treea5ecacfca5c28b8be7104d8ea5a5ac6c8cd53691
parentbcd1ac7120e04cc60491005771aee5f27abac220
net/http: add errors.As support for x/net/http2.StreamError

To make it easier to extract the HTTP/2 error code (if any) from
net/http errors, implement an As method on the vendored copy of
golang.org/x/net/http2.StreamError. The new As method lets users work
with the vendored error type as though it were the x/net/http2
StreamError.

Fixes #53896.

Change-Id: Ib18eb428adc05a3c0e19a946ece936e2378e1c7c
Reviewed-on: https://go-review.googlesource.com/c/go/+/425104
Run-TryBot: Damien Neil <dneil@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: David Chase <drchase@google.com>
src/net/http/h2_error.go [new file with mode: 0644]
src/net/http/h2_error_test.go [new file with mode: 0644]