Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleHTTPPanic ¶
func HandleHTTPPanic(rw http.ResponseWriter, rq *http.Request)
HandleHTTPPanic should be executed in a deferred method (or deferred directly) in http middleware. It will capture any panics that occur in the goroutine it exists, and report to the registered global panic handler. HTTP handler panics will have the errors.PanicTypeHTTP Type.
func HandlePanic ¶
func HandlePanic()
HandlePanic should be executed in a deferred method (or deferred directly). It will capture any panics that occur in the goroutine it exists, and report to the registered global panic handler.
func PanicHandlerMiddleware ¶
PanicHandlerMiddleware should wrap any of the http handlers to capture panics.
func SetPanicHandler ¶
func SetPanicHandler(handler PanicHandler) error
SetPanicHandler sets the handler that is executed when any panic is captured by HandlePanic(). Without setting a handler, the panic reporting is disabled.
Types ¶
type PanicHandler ¶
PanicHandler is a func that receives a Panic and returns a bool representing whether or not the panic should recover or not.