Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net/http: wrap more errors? #36713

josharian opened this issue Jan 23, 2020 · 2 comments

net/http: wrap more errors? #36713

josharian opened this issue Jan 23, 2020 · 2 comments


Copy link

@josharian josharian commented Jan 23, 2020

While trying to understand some net/http errors, I found that many net/http errors don't wrap their underlying errors yet (run grep -R "fmt.Errorf.*%v" net/http to see some).

@bradfitz are you open to making the default be to wrap errors in net/http? That is, can someone do a somewhat indiscriminate pass through net/http, wrapping errors everywhere they see an opportunity to do so?

@josharian josharian changed the title net/http: wrap more errors net/http: wrap more errors? Jan 23, 2020
@toothrot toothrot added this to the Backlog milestone Jan 23, 2020
@toothrot toothrot added the NeedsInvestigation label Jan 23, 2020
Copy link

@bukowa bukowa commented Feb 9, 2020

For example

return nil, fmt.Errorf("net/http: invalid method %q", req.Method)

return nil, fmt.Errorf("net/http: invalid method %q", method)

err = errors.New("net/http: server replied with more than declared Content-Length; truncated")

There's also Get dial tcp: lookup getaddrinfow: This is usually a temporary error during hostname resolution and means that the local server did not receive a response from an authoritative server. that i cannot find in the lib.

Copy link

@gopherbot gopherbot commented Jan 31, 2021

Change mentions this issue: net/http: indiscriminately wrap errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

4 participants