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

Open
josharian opened this issue Jan 23, 2020 · 1 comment
Open

net/http: wrap more errors? #36713

josharian opened this issue Jan 23, 2020 · 1 comment
Milestone

Comments

@josharian
Copy link
Contributor

@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
@bukowa

This comment has been minimized.

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 http://X.com: dial tcp: lookup X.com: 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.

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

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.