getsentry / raven-go

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

missing ServeHTTP method #182

Closed algogrit closed 5 years ago

algogrit commented 6 years ago

cannot use ravenHandler (type func(http.ResponseWriter, http.Request)) as type http.Handler in argument to n.UseHandler: func(http.ResponseWriter, http.Request) does not implement http.Handler (missing ServeHTTP method)

I am wrapping the http.HandlerFunc using raven.RecoveryHandler; when trying to use with Negroni.

algogrit commented 6 years ago

Perhaps changing the signature from:

func RecoveryHandler(handler func(http.ResponseWriter, *http.Request)) func(http.ResponseWriter, *http.Request)

to

func RecoveryHandler(handler http.HandlerFunc) http.HandlerFunc

might help?