getsentry / raven-go

Sentry client in Go
https://sentry.io
BSD 3-Clause "New" or "Revised" License
561 stars 148 forks source link

add raven.Recoverer(handler http.Handler) http.Handler #193

Closed alexflint closed 6 years ago

alexflint commented 6 years ago

This pr adds raven.Recoverer to complement raven.RecoveryHandler. The main difference is that raven.Recoverer takes an http.Handler and returns an http.Handler. This is a small difference, but it means that in frameworks such as Chi, one can use raven as middleware:

r := chu.NewRouter()
r.Use(raven.Recoverer)
...

The original raven.RecoveryHandler remain unchanged

Fixes #182

hd-deman commented 6 years ago

any updates on this?