summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-09-19 13:53:33 -0400
committerRuss Cox <rsc@golang.org>2014-09-19 13:53:33 -0400
commit5656feb6ad328e0035886a233675d6d9f91696cb (patch)
tree2ff22d2e6c07bdf4846f384554e98b3542d7f028 /src/net
parent6b9d4e3b4c0c8e124e7c4a121eadfdc761201e27 (diff)
downloadgo-5656feb6ad328e0035886a233675d6d9f91696cb.tar.gz
net/http: document server recovering panics
Fixes issue 8594. LGTM=bradfitz R=bradfitz CC=golang-codereviews https://codereview.appspot.com/145760043
Diffstat (limited to 'src/net')
-rw-r--r--src/net/http/server.go6
1 files changed, 6 insertions, 0 deletions
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)
}