Documentation
¶
Overview ¶
Package recovr is a HTTP middleware that catches any panics and serves a proper error response.
package main import ( "net/http" "github.com/afansv/recovr" ) var myPanicHandler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { panic("you should not have a handler that just panics ;)") }) func main() { recovery := recovr.New() app := recovery(myPanicHandler) http.ListenAndServe("0.0.0.0:3000", app) }
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.