From 5656feb6ad328e0035886a233675d6d9f91696cb Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Fri, 19 Sep 2014 13:53:33 -0400 Subject: net/http: document server recovering panics Fixes issue 8594. LGTM=bradfitz R=bradfitz CC=golang-codereviews https://codereview.appspot.com/145760043 --- src/net/http/server.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/net/http/server.go b/src/net/http/server.go index 203037e9f..8f2b777b2 100644 --- a/src/net/http/server.go +++ b/src/net/http/server.go @@ -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) } -- cgit v1.2.1