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: document, audit ProtocolError #17558

Closed
bradfitz opened this issue Oct 23, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@bradfitz
Copy link
Member

commented Oct 23, 2016

https://golang.org/pkg/net/http/#ProtocolError is a bit of an oddball.

It's used a little:

$ git grep ProtocolError
httputil/persist.go:    ErrPersistEOF = &http.ProtocolError{ErrorString: "persistent connection closed"}
httputil/persist.go:    ErrClosed     = &http.ProtocolError{ErrorString: "connection closed by user"}
httputil/persist.go:    ErrPipeline   = &http.ProtocolError{ErrorString: "pipeline error"}
request.go:type ProtocolError struct {
request.go:func (err *ProtocolError) Error() string { return err.ErrorString }
request.go:     ErrHeaderTooLong        = &ProtocolError{"header too long"}
request.go:     ErrShortBody            = &ProtocolError{"entity body too short"}
request.go:     ErrNotSupported         = &ProtocolError{"feature not supported"}
request.go:     ErrUnexpectedTrailer    = &ProtocolError{"trailer header without chunked transfer encoding"}
request.go:     ErrMissingContentLength = &ProtocolError{"missing ContentLength in HEAD response"}
request.go:     ErrNotMultipart         = &ProtocolError{"request Content-Type isn't multipart/form-data"}
request.go:     ErrMissingBoundary      = &ProtocolError{"no multipart boundary param in Content-Type"}

Should it be used more? Are those error variables even used?

Check. If ProtocolError isn't consistently used and we don't want to make it so, document that it's not always used.

@bradfitz bradfitz added this to the Go1.8Maybe milestone Oct 23, 2016

@bradfitz bradfitz self-assigned this Oct 23, 2016

@gopherbot

This comment has been minimized.

Copy link

commented Nov 10, 2016

CL https://golang.org/cl/33096 mentions this issue.

@gopherbot gopherbot closed this in 63224ca Nov 10, 2016

@golang golang locked and limited conversation to collaborators Nov 10, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.