mirror of https://github.com/golang/go.git
net/http: document some errors more, mark ErrWriteAfterFlush as unused
Fixes #15150 Change-Id: I1a892d5b0516a37dac050d3bb448e0a2571db16e Reviewed-on: https://go-review.googlesource.com/22658 Reviewed-by: Andrew Gerrand <adg@golang.org>
This commit is contained in:
parent
d713e8e806
commit
b3a130e81a
|
|
@ -29,12 +29,26 @@ import (
|
|||
"time"
|
||||
)
|
||||
|
||||
// Errors introduced by the HTTP server.
|
||||
// Errors used by the HTTP server.
|
||||
var (
|
||||
ErrWriteAfterFlush = errors.New("Conn.Write called after Flush")
|
||||
ErrBodyNotAllowed = errors.New("http: request method or response status code does not allow body")
|
||||
ErrHijacked = errors.New("Conn has been hijacked")
|
||||
ErrContentLength = errors.New("Conn.Write wrote more than the declared Content-Length")
|
||||
// ErrBodyNotAllowed is returned by ResponseWriter.Write calls
|
||||
// when the HTTP method or response code does not permit a
|
||||
// body.
|
||||
ErrBodyNotAllowed = errors.New("http: request method or response status code does not allow body")
|
||||
|
||||
// ErrHijacked is returned by ResponseWriter.Write calls when
|
||||
// the underlying connection has been hijacked using the
|
||||
// Hijacker interfaced.
|
||||
ErrHijacked = errors.New("http: connection has been hijacked")
|
||||
|
||||
// ErrContentLength is returned by ResponseWriter.Write calls
|
||||
// when a Handler set a Content-Length response header with a
|
||||
// declared size and then attempted to write more bytes than
|
||||
// declared.
|
||||
ErrContentLength = errors.New("http: wrote more than the declared Content-Length")
|
||||
|
||||
// Deprecated: ErrWriteAfterFlush is no longer used.
|
||||
ErrWriteAfterFlush = errors.New("unused")
|
||||
)
|
||||
|
||||
// A Handler responds to an HTTP request.
|
||||
|
|
|
|||
Loading…
Reference in New Issue