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
Closed

net/http: document, audit ProtocolError #17558

bradfitz opened this issue Oct 23, 2016 · 1 comment
Labels
Documentation FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@bradfitz
Copy link
Contributor

bradfitz 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 Documentation NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Oct 23, 2016
@bradfitz bradfitz added this to the Go1.8Maybe milestone Oct 23, 2016
@bradfitz bradfitz self-assigned this Oct 23, 2016
@gopherbot
Copy link

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

@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.
Labels
Documentation FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

2 participants