Commit 1146a9b9 authored by Matthew Holt's avatar Matthew Holt

Recover from panic during requests

parent 2fbfafc4
...@@ -101,6 +101,11 @@ func (s *Server) Serve() error { ...@@ -101,6 +101,11 @@ func (s *Server) Serve() error {
// ServeHTTP is the entry point for each request to s. // ServeHTTP is the entry point for each request to s.
func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) { func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
defer func() {
if rec := recover(); rec != nil {
log.Printf("[PANIC] '%s': %s", r.URL.String(), rec)
}
}()
s.stack(w, r) s.stack(w, r)
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment