1
0
mirror of https://github.com/golang/go synced 2024-11-23 04:50:06 -07:00

net/http: document server recovering panics

Fixes #8594.

LGTM=bradfitz
R=bradfitz
CC=golang-codereviews
https://golang.org/cl/145760043
This commit is contained in:
Russ Cox 2014-09-19 13:53:33 -04:00
parent 5c795632d6
commit 2c15d45131

View File

@ -42,6 +42,12 @@ var (
// and then return. Returning signals that the request is finished
// and that the HTTP server can move on to the next request on
// the connection.
//
// If ServeHTTP panics, the server (the caller of ServeHTTP) assumes
// that the effect of the panic was isolated to the active request.
// It recovers the panic, logs a stack trace to the server error log,
// and hangs up the connection.
//
type Handler interface {
ServeHTTP(ResponseWriter, *Request)
}