hatpear.go
func Recover() Middleware {
	return func(next http.Handler) http.Handler {
		return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
			defer func() {
				if v := recover(); v != nil {
					Store(r, PanicError{
						value: v,
						stack: stack(1),
					})
				}
			}()
			next.ServeHTTP(w, r)
		})
	}
}
func Recover() Middleware {
	return func(next http.Handler) http.Handler {
		return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
			defer func() {
				if v := recover(); v != nil {
					Store(r, PanicError{
						value: v,
						stack: stack(1),
					})
				}
			}()
			next.ServeHTTP(w, r)
		})
	}
}
// Recover creates middleware that can recover from a panic in a handler,
// storing a PanicError for future handling.